I have two tables like this. First table has City, Case_ID and Client_ID.
Second table has Case_ID and Client_ID.
I don't want to count the Case_ID, if there is atleast 1 CASE_ID, Client_ID combination existing in Table-2.
Example: For the Case_ID = 111, there is 1 match where Client_ID 345 is existing in Table-1 and Table-2. So, i don't want to count the Case_ID 111 in my count.
How to code it in SQL? Please help.
CITY CASE_ID CLIENT_ID
CITY1 111 345
CITY1 111 346
CITY2 222 347
CITY3 333 348
CITY3 333 349
CITY3 444 350
CITY COUNT(DISTINCT CASE_ID)