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!

Exclude or combine duplicate rows

867941Jun 9 2011 — edited Jun 10 2011
Hoping to get some help on this.

I have been trying to find a way to combine Dep. and Arriv. columns without losing the unique values.
Unfortunately, I do not have a time stamp for each column (which would make things much easier).
The only distinguishing value is in Dep. column.

Pr. Dep. Arriv.
1 ORY LHR
1 LHR ORY
2 GOT LOS
2 LOS GOT
3 CDG IST
3 IST CDG
4 YYC FRA
4 HRE YYC
5 BLR GOI
5 GOI BLR
6 CDG IST
6 IST CDG

The result that I am trying to accomplish is:
Option 1) -Combining the columns and grouping by Pr.

Pr. Dep.-Arriv.
1 ORY - LHR - ORY
2 GOT - LOS - GOT
3 CDG - IST - CDG
4 YYC - FRA - HRE - YYC

Option 2) -Ignoring the duplicate row based on the dep. arriv. value

Pr. Dep. Arriv.
1 ORY LHR
2 GOT LOS
3 CDG IST
4 YYC FRA
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2011
Added on Jun 9 2011
16 comments
1,449 views