当前位置: 代码迷 >> Sql Server >> 请问这样一个语句如何写
  详细解决方案

请问这样一个语句如何写

热度:125   发布时间:2016-04-27 19:37:04.0
请教这样一个语句怎么写
三个表,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 '
  相关解决方案