Msg 156, Level 15, State 1, Line 107
Incorrect syntax near the keyword 'on'.
我有一个相当大的查询,我将只提供其中的一小部分。我收到以下语法错误ON
SplitAddresses.Client_id=d_client.CLIENT_ID
:
...
left join
(SELECT distinct
T.MLIS_CLIENT_ADDRESS_1,T.Client_id,
Left(T.MLIS_CLIENT_ADDRESS_1, IsNull(SplitAddresses.Pos - 1, 2147483647)) Address1,
Substring(T.MLIS_CLIENT_ADDRESS_1, SplitAddresses.Pos + 1, 2147483647) Address2
FROM
d_client
T
OUTER APPLY (
SELECT TOP 1 NullIf(PatIndex(Delimiter, T.MLIS_CLIENT_ADDRESS_1), 0) Pos
FROM (
VALUES ('% Suite %'), ('% Ste %'), ('% Bldg %'), ('% Building %'), ('%#%')
) SplitAddresses (Delimiter)
WHERE T.MLIS_CLIENT_ADDRESS_1 LIKE SplitAddresses.Delimiter
ORDER BY Pos
) SplitAddresses
on
SplitAddresses.Client_id=d_client.CLIENT_ID
WHERE...
我是在语法上做了一些明显错误还是有更深层次的问题?非常感谢你的帮助。