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!

select result without same rows

User_48J1WDec 24 2020

Hi!
Could you please give me advice, i have some select
select
o.field1,
o.field2,
o.field3,
b.field4,
b.field5
from orders o
inner join bill b
on o.orders_id = b.orders_id
and b.PARAM_ID in ('PARAM1', 'PARAM2', 'PARAM3');

and result set will be something like this, i need to get fields 3-4-5, but field 1-2 will be the same;
field1 field2 field3 (PARAM1)
field1 field2 field4 (PARAM2)
field1 field2 field5 (PARAM3)
...
field1 field2 field3 (PARAM1)
field1 field2 field4 (PARAM2)
field1 field2 field5 (PARAM3)

how i can change it, to get data like this, without repeating field1 field2 and selecting their field 3-4-5 at row :
field1 field2 PARAM1 PARAM2 PARAM3
...
field1 field2 PARAM1 PARAM2 PARAM3

Comments
Post Details
Added on Dec 24 2020
1 comment
72 views