select a.code,a.no,b.date,c.age
from a
inner join b
on a.code=b.code
inner join c
on c.no=a.no and c.date=b.date
這樣?
select a.code,a.no,b.date,c.age
from a, b,c
where a.code=b.code and c.no=a.no and c.date=b.date
--try
select a.code,a.no,b.date,c.age
from a join b on a.code=b.code
left join c on c.no=a.no and c.date=b.date
--這三個中你要的是哪個?
select c.* from c
left join a on c.no = a.no where a.code = '01'
select c.* from c
left join b on c.date = b.date where b.code = '01'
select c.* from
left join a on c.no = a.no
left join b on c.date = b.date
where a.code = '01' and b.code = '01'
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。