分别有这样的两个SQL语句:
A:
select id as 编号,name as 名称 ,[规格] from A left join (selct [规格] from B) as tableb on A.id=tableb.id
B:
select id as 编号,name as 名称 ,[规格] from A left join B as tableb on A.id=tableb.id
它们之间有什么不同?
...全文
666打赏收藏
这两个语句有什么不同
分别有这样的两个SQL语句: A: select id as 编号,name as 名称 ,[规格] from A left join (selct [规格] from B) as tableb on A.id=tableb.id B: select id as 编号,name as 名称 ,[规格] from A left join B as tableb on A.id=tableb.id 它们之间有什么不同?
结果没有什么不同,效率上应该是b比较好
另外:这个语句编译应该是不通过的,因为,没有为id指明所属表名,应该这样
select A.id as 编号,name as 名称 ,[规格] from A left join (selct [规格] from B) as tableb on A.id=tableb.id