sam2929
asked on
finding different address based on same id
i Have
ID ADDR
1001 'AAA'
1001 'BBB'
1002 'BBB'
1003 'CCC'
1002 'BBB'
how can i find how many same ID has different ADDR OUPUT
ID ADDR
1001 'AAA'
1001 'BBB'
ID ADDR
1001 'AAA'
1001 'BBB'
1002 'BBB'
1003 'CCC'
1002 'BBB'
how can i find how many same ID has different ADDR OUPUT
ID ADDR
1001 'AAA'
1001 'BBB'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
select * from yourtable
where id in (select id from yourtable group by id having count(distinct addr) > 1)