Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
darms21
Yak Posting Veteran
54 Posts |
Posted - 2013-03-25 : 12:47:34
|
Greetings,I have the following tables:Table AUUIDComputer_NameTable BUUID ProcedureUUIDTable CProcedureUUIDSW_NameI have the following query which shows me all instances where SoftwareX is install on a system:SELECT * FROM A JOIN B ON A.UUID = B.UUID JOIN C ON B.ProcedureUUID= C.ProcedureUUIDWHERE SW_Name like 'SoftwareX' I would like to be able, in one result set, to identify not only those systems that have SoftwareX installed but also system that do not. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-25 : 13:21:52
|
[code]SELECT * FROM A JOIN B ON A.UUID = B.UUID LEFT JOIN C ON B.ProcedureUUID= C.ProcedureUUIDAND SW_Name like 'SoftwareX'[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
darms21
Yak Posting Veteran
54 Posts |
Posted - 2013-03-25 : 15:11:29
|
I appreciate the help but that is not a solution to this query. That does not necessarily identify all records from Table A that may not be in Table B or Table C.What I have come up w/ however that does appear to work is the following:SELCT *(SELECT * FROM A JOIN B ON A.UUID = B.UUID JOIN C ON B.ProcedureUUID= C.ProcedureUUIDWHERE SW_Name like 'SoftwareX') AS DRV1RIGHT OUTER JOIN A on DRV1.Name = A.Name |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-26 : 14:45:59
|
[code]SELECT * FROM A LEFT JOIN B ON A.UUID = B.UUID LEFT JOIN C ON B.ProcedureUUID= C.ProcedureUUIDAND SW_Name like 'SoftwareX'[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|