当前位置: 代码迷 >> Sql Server >> 请大家帮忙看看这个SQL语句,该怎么处理
  详细解决方案

请大家帮忙看看这个SQL语句,该怎么处理

热度:113   发布时间:2016-04-27 19:24:37.0
请大家帮忙看看这个SQL语句
现在有这样的一个数据表(SP)
供应商号(Sno) 零件号(Pno) 零件数量(Qty)

查询至少包含了供应商号"168"所供应的全部零件的Sno
请大家帮忙看看这个SQL语句怎么填写完整?谢谢

select Sno
 from SP SPX
where ___
(select * from SP spy where ____and not exists
(select * from SP spz where ____));



------解决方案--------------------
SQL code
select * from (select * from SP where (select count(*) from SP group by id having Sno='168')>=1)a where 条件
------解决方案--------------------
select * from sp where charindex('168',sno)>0
------解决方案--------------------
SQL code
select * from sp where charindex( '168',sno) >0--select * from sp where sno like '%168%'select * from sp where sno like '168%'select * from sp where sno like '%168'
------解决方案--------------------
select Sno
 from SP SPX
where ___
(select * from SP spy where ____and not exists
(select * from SP spz where ____));
楼主意思就用这个格式?
  相关解决方案