Hi,
I need a query to find an employeeid who work in different departments and vomit single eid
deptid eid
101 1
212 1
314 1
100 2
412 3
506 3
618 3
expected output as follows
deptid eid
101 1
212 1
314 1
412 3
506 3
618 3
Thanks in advance.


rajendra singhRank #1,522 · 1K reputationPosted Jul 18, 2018, 9:50 PM EDT
Jefferson S. MottaRank #207 · 11.7K reputationPosted Jul 27, 2018, 6:14 PM EDT
Packiaraj SanthiyaguRank #659 · 3.6K reputationPosted Jul 27, 2018, 9:24 PM EDT
Jenith ThakkarRank #789 · 2.9K reputationPosted Jul 18, 2018, 10:36 PM EDT
WITH CTE AS (
Jignesh KumarRank #91 · 22.9K reputationPosted Jul 27, 2018, 10:12 PM EDT
Jenith ThakkarRank #789 · 2.9K reputationPosted Jul 18, 2018, 9:48 PM EDT
Sai ReddyRank #6,320 · 270 reputationPosted Jul 18, 2018, 9:52 PM EDT