Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Item id associated with more than one item query help

3537462Jan 24 2019 — edited Jan 24 2019

Hi, I have transaction data like below

pastedImage_1.png

I need help in writing SQL to get items that are associated with more than one item id (distinct) --

In the above case like i need to list data that is hi-lighted -- Because this is data error.

8366 SXZ4369

73679 SXZ4369

4366 AYZ4369

63679 AYZ4369

Below are table and insert scripts scripts:

create table xx_test1(item_id number, item_number varchar2(80))

insert into xx_test1 values (8366,'SXZ4369');

insert into xx_test1 values (73679,'SXZ4369');

insert into xx_test1 values (430,'NYKZ41');

insert into xx_test1 values (430,'NYKZ41');

insert into xx_test1 values (4366,'AYZ4369');

insert into xx_test1 values (63679,'AYZ4369');

insert into xx_test1 values (530,'BYKZ41');

insert into xx_test1 values (530,'BYKZ41');

Thanks,

This post has been answered by mathguy on Jan 24 2019
Jump to Answer
Comments
Post Details
Added on Jan 24 2019
3 comments
235 views