sam2929
asked on
to find non matching records
Hi,
i want to find the request id which has diffrent centre for same request id
request id centre
1001 8214
1001
1001 8214
1002 601
1002
1002 701
so result should be null can be filtered
1002 601
1002 701
i want to find the request id which has diffrent centre for same request id
request id centre
1001 8214
1001
1001 8214
1002 601
1002
1002 701
so result should be null can be filtered
1002 601
1002 701
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The suggested approach would give the result shown as long as every mismatch resulted in exactly count(*)=1. It would include all requestId values that only appeared in single rows as well as those that had multiple rows but single occurrences of centre.
What version of DB2 are you running?
What result do you want if the data looks this way:
request id centre
1001 8214
1001
1001 8214
1002 601
1002 601
1002
1002 701
1003 5701
Tom
What version of DB2 are you running?
What result do you want if the data looks this way:
request id centre
1001 8214
1001
1001 8214
1002 601
1002 601
1002
1002 701
1003 5701
Tom
Hi!
This should give you what you need
select distinct requestId, centre,
from deleteme
where centre is not null
Regards,
Tomas Helgi
This should give you what you need
select distinct requestId, centre,
from deleteme
where centre is not null
Regards,
Tomas Helgi
Open in new window