How can I query a Microsoft SQL table to return only an InstNum that has all Profile type 'C' or 'U'?
Please see my table structure below.
I tried :
Select InstNum from Table Where Profile = 'C' Group By InstName;
RESULT : 001, 002, 003
EXPECTING : 003 (Because all Profiles in 003 is 'C')
InstNum | Profile |
---|---|
001 | U |
001 | C |
001 | U |
002 | U |
002 | U |
002 | U |
003 | C |
003 | C |
003 | C |
Any help is really appreciated!
002
? Isn't your conditionreturn only an InstNum that has all Profile type 'C' or 'U'
?