日期:2014-05-18  浏览次数:20502 次

请教这样一个语句怎么写
三个表,mst4100c,mst4000c,mst2000c
都有字段   图号:headno   状态:   status_code    


要提取mst2000c中状态不为X0(停用)的图号且存在于mst4000c中的图号,作为mst4100c的图号

如何写呢?

------解决方案--------------------
select a.* from mst2000c a join mst4000c b on a.headno=b.headno where b.status_code <> 'X0 '
------解决方案--------------------
select a.* from mst4100c a, mst2000c b where a.headno = b.headno and b.status_code <> 'XO '