34,575
社区成员
发帖
与我相关
我的任务
分享
select a.item1_name,isnull(a.item2_name,'空'),b.projectid
from table_1 a right join table_2 b
on a.item1_id=b.item1_id and a.item2_id=b.item2_id
select item1_Name=(select distinct item1_Name from table1 where item1_id= a.item1_id),
item2_Name=(select distinct item2_Name from table1 where item2_id= a.item2_id),
projectid from table2 t
select a.item1_Name,isnull(a.item2_Name,'空') item2_Name,b.ProjectID
from table2 b
left join table1 a
on a.item1_id=b.item1_id
and a.item2_id=b.item2_id
select a.item1_Name,a.item2_Name,b.ProjectID
from table2 b
left join table2 a
on b.item1_id=a.item1_id and a.item2_id=b.item2_id
select
t1.item1_Name,
isnull(t1.item2_Name,'空'),
t2.ProjectID
from table2 t2
left join table1 t1
on t1.item1_id=t2.item1_id and t1.item2_id=t2.item2_id
select item1_Name,Item2_name,ProjectID from table2 left join table1 on table1.item2_id=table2.item2_id where table1.item1_id=table2.item1_id
select a.item1_name,a.item2_name,b.projectid from table1 a join table2 b on a.item1_id=b.item1_id and a.item2_id=b.item2_id
select a.item1_Name , b.item2_Name ,a.ProjectID
from table2 a
left join table1 b on a.item2_id=b.item2_id