Sunday 15 March 2015

SQL - Select Distinct filtering -


I have to get every entry in a table, which does not have a specific value. I am writing a report which will be assigned a specific workstation name In which the specific software ID is not installed. The table I am pulling is an entry for every software installed on every machine.

  Choose a different from the table ws_name table WHERE software_ id 123 does not exist  

I do not know which code to replace "does not exist" ws_name If I understand the question correctly, then the code above

S is software_id = 123 in any of the rows if it is correct, then you will need a subquery:

  Select one from mytable ws_name where a fun (Not select * from mytable b WHERE a.ws_name = b.ws_name and b.software_id = 123)  

or with a subquery in operator Use:

  Select My Location from ws_name mytable ws_name not (Select Ws_name mytable from WHERE software_id = 123)  

No comments:

Post a Comment