我有一个看起来像这样的代码
Select *
Into #DTemp
From
(Select A, B, C, D
From
T1 LEFT OUTER JOIN T2 ON T1.I=T2.I
LEFT OUTER JOIN
T3 ON T2.I = T3.I
....
T6 ON T5.I = T6.I
WHERE
A = 'THE'
AND B LIKE '%YYYY%
AND C >= (TIME)
)
但是我在最后一个括号中出现错误,上面写着“语法不正确”)。
由于我的括号是正确的,因此不确定为什么会出现错误。
答案 0 :(得分:1)
AND B LIKE '%YYYY%
之后您缺少单引号。并在关闭)
后添加别名
检查以下代码中的箭头指针
Select *
Into #DTemp
From
(Select A, B, C, D
From
T1 LEFT OUTER JOIN T2 ON T1.I=T2.I
LEFT OUTER JOIN
T3 ON T2.I = T3.I
....
T6 ON T5.I = T6.I
WHERE
A = 'THE'
AND B LIKE '%YYYY%' //<---
AND C >= (TIME)
) tablenamehere //<---