Question : Oracle query

can anyone advise on following sql-
TABLE A HAS COL- ID,code,acno
How can i retreive records which have more than one unique value of (code,acno) base on ID

Example-
id  code acno
1   A    3
1   A    3
2   A    3
2   b    3

Result expected is-

2 b 3
2 A 3

Answer : Oracle query

select id,code,acno from
(select id,code,acno,count(*) over(partition by id,code,acno)  cntcombo,count(*) over (partition by id) cntid from tablea)
where cntcombo != cntid;

Random Solutions  
 
programming4us programming4us