using not with sub-queries

后端 未结 2 731
星月不相逢
星月不相逢 2021-01-28 00:57

I have been asked to display results in my sql server database for the following question

What software packages are not installed on any HP computers?

2条回答
  •  孤独总比滥情好
    2021-01-28 01:36

    ;with installed as
    ( select PACK from software where TAGNUM in ( select tagnum from PC where comp in ( select comp from computer where MFRNAME = 'HP')))
    select * from Package p left join installed i on p.pack = i.pack
    where i.pack is null
    

提交回复
热议问题