我有以下代码:
-- start of code
set noexec off
declare @requiredVersion int
declare @currentVersion int
set @requiredVersion = 5
set @currentVersion = 4
if (@currentVersion < @requiredVersion)
begin
print 'Please update your DB to version 5 before running this script.'
set noexec on
end
go
-- print 'Dummy'
insert into tblFooBar(name) values ('AAA')
go
set noexec off
-- end of code
Run Code Online (Sandbox Code Playgroud)
请注意,数据库中不存在表"tblfoobar".当我运行此代码时,消息出现:
Please update your DB to version 5 before running this script. Msg 208, Level 16, State 1, Line 1 …
我是具有 SQL Server 背景的 Google Sheet 查询新手。我的工作表在这里:
该文件包含多个工作表。我正在尝试编写一个查询来从员工姓名中获取员工编号,然后使用此结果来获取员工的分配信息。
到目前为止我尝试过的事情:
查询从姓名获取员工编号:(工作正常)
query(Individual!A2:AL25,"select N, Q, O where AL = 'Christian Slater'")
Run Code Online (Sandbox Code Playgroud)
上面的查询返回 Employee 的某些列。N 列是 Employee_Number。
查询以获取该员工的分配结束日期:
=query(Assignments!A1:R1001,"select * where G = (query(Individual!A2:AL25,"select N, Q, O where AL = 'Christian Slater'"))")
Run Code Online (Sandbox Code Playgroud)
我收到公式解析错误 - 显然我没有使用正确的语法。如果有人能为我指出正确的方向和有用的资源,我将不胜感激。