create table a_D(
id int,
inNum varchar(10),
inID int
)
insert into a_D values(1,'I0001',1)
insert into a_D values(2,'I0002',2)
create table b_D(
id int,
outNum varchar(10),
outID int
)
insert into b_D values(1,'O0001',1)
select a.inNum,b.outNum
from a_D a left join b_D b
on a.id=b.id
drop table a_D,b_D
/*
inNum
outNum
---------- ----------
I0001
O0001
I0002
NULL
(所影响的行数为 2 行)
*/
我是看不懂a,b表有什么用..