有这样一个查询的差异:

两张表如下:

条件放在left join后面和where后面

语句在这里:

 1 create table #AA
 2 (
 3   ID int,
 4   Name nvarchar(50)
 5 )
 6 
 7 insert into #AA
 8 select 1,'项目1'
 9 union all
10 select 2,'项目2'
11 union all
12 select 3,'项目3'
13 union all
14 select 4,'项目4'
15 union all
16 select 5,'项目5'
17 
18 create table #BB
19 (
20   ID int,
21   ProjectID int,
22   Name nvarchar(50)
23 )
24 
25 insert into #BB
26 select 1,1,'绿化园林'
27 union all
28 select 2,2,'安装玻璃'
29 union all
30 select 3,3,'拉电线'
View Code

相关文章:

  • 2021-06-15
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
  • 2021-08-07
  • 2021-04-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-02
  • 2021-11-29
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
相关资源
相似解决方案