sql server, left join on,on附近有语法错误

select cast(Service_Order_No as nvarchar)+CAST(Item_No as nvarchar) as 'Key1', 
Service_Order_No, Item_No 
from dbo.GH_Billing_ID_TH_MY_IN as A 
left join 
(select cast([Service Order ID] as nvarchar)+CAST([Service Order Line] as nvarchar) as 'Key2', 
[Service Order ID],[Service Order Line] 
from dbo.SO_Raw_All as B) 
on A.Key1= B.Key2;
提示:
消息 156,级别 15,状态 1,第 8 行
关键字 'on

白衣染霜花
浏览 1075回答 3
3回答

函数式编程

select (cast(Service_Order_No as nvarchar)+CAST(Item_No as nvarchar) )as 'Key1',Service_Order_No 这个地方错了对应的,这个地方也错了select (cast([Service Order ID] as nvarchar)+CAST([Service Order Line] as nvarchar)) as 'Key2',
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

SQL Server