so here is my select statement:
SELECT UserID, city, state, [KEY], ProfileID
Each USERID may have multiple Cities (i.e. multiple rows.)
FOR EXAMPLE, this is typical data:
1159 Burnaby British Columbia 10195 LEGACY
1160 Edmonton Alberta 439 LEGACY
1160 Spruce Grove Alberta 1299 I-ZZUUDDASD
1160 Beaumont Alberta 1300 I-EEF7834KDFJA
1165 Langley British Columbia 441 LEGACY
1165 Abbotsford British Columbia 15488 LEGACY
The ProfileID will always be either LEGACY or a unique character string.
A userID may have only 1 city assiged, or multiple cities assigned.
What I want to do is select * of all the USERID's who have at least 1 Legacy AND at least 1 non-legacy profileID.
How can I do this?
so in the data above, 1160 gets flagged
The reason is because we need to audit our code to make sure that every userID is either all Legacy or has ProfileID's. There should be no "mixed modes" and if there is, I want to locate them.