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!

Need to filter out lead records - SQL

user11942774Apr 13 2021 — edited Apr 13 2021

Hi Team,
Currently i have a table for employee (5million records) with below columns:
id emp_buss_id emp_buss_lead_id emp_lead_flag
1 WA123 WA345 0
2 WA124 WA345 1
3 WA125 WA345 0
4 WA126 WA376 1
5 WA127 WA377 0
6 WA128 WA378 0
7 WA129 WA349 0
8 WA130 WA349 1

I need to filter out the data and display if the records are having same lead_id
expected output:
id emp_buss_id emp_buss_lead_id emp_lead_flag
1 WA124 WA345 1
4 WA126 WA376 1
5 WA127 WA377 0
6 WA128 WA378 0
8 WA130 WA349 1

This post has been answered by Alex Nuijten on Apr 13 2021
Jump to Answer
Comments
Post Details
Added on Apr 13 2021
4 comments
257 views