Hello:
I need some assistance with developing a query that pulls all (invalid states). I'm sure this is a simple SQL query but I just haven't been able to figure it out.
Let me start by saying this thread is NOT about a "geography lesson"... I am merely using city/state relationships to illustrate dual-mapping. Please see attached JPG (same table is attached w/o field [COMMENT]).
Background on *sample* data:
- A value (e.g., "City") is repeated several times in the table.
- A record is considered *valid* as long as there is only one (1) parent value (e.g., "State") for it.
- For example, [CITY] = "Dallas" appears 3 times. This record is valid since all 3 state values = "Texas".
- Alternatively, [CITY] = "San Diego" occurs 5 times. It is an invalid record since it does have two (2) parent values (twice "California" and 3 times "New York").
Out of the 20 records, the query should return the following 4 (invalid) grouped records:
1. Miami | Florida
2. Miami | Georgia
3. San Diego | California
4. San Diego | New York
What SQL would return these 4 values?
Thanks
skydivetom