sql - Need a query to find the records that have different values for same id in multiple rows -
i confused here.
i need find custtreenodeid
's have (preferenceid
= 55 , overridevalue
= 1 ), (preferenceid
= 56 , overridevalue
= 1),(preferenceid
= 58 , overridevalue not null
).
the record should have 3 preferenceid
, should statisfy 3 conditions mentioned above.
example - see custtreenodeid
= 76853551-7acd-48e1-beff-0000498a144c
in screenshot.
these gives custtreenodepreferenceoverrideid need
select custtreenodepreferenceoverrideid yourtable ( condition 1 ) or ( condition 2 ) or ( condition 3 ) group custtreenodepreferenceoverrideid having count(*) = 3
Comments
Post a Comment