oleanganesh
MIS
Hi
I have 2 tables:
Employees
---------
empid
EmpGroup
--------
empid
Groupid
I would like to write a query to fetch the empid,Groupid from empgroup table ONLY if the empid in empgroup table has an exact match for the empid in Employees table for the groupid in empgroup table.
Sample Employees table data:
------------------
Empid
5
6
7
35
Sample EmpGroup Table data:
----------------------------
Empid GroupId
5 3
6 3
7 3
5 4
6 4
8 4
====================================
I would like to have the records like
Empid GroupId
5 3
6 3
7 3
Records for empidid=5,6,8 and groupid=4 under empgroup table shouldnt be listed as empid =8 is missing in Employees.empid
How can i write a program or query to get the results as in my sample records result?
Any help appreciated
Thanks
Gk
I have 2 tables:
Employees
---------
empid
EmpGroup
--------
empid
Groupid
I would like to write a query to fetch the empid,Groupid from empgroup table ONLY if the empid in empgroup table has an exact match for the empid in Employees table for the groupid in empgroup table.
Sample Employees table data:
------------------
Empid
5
6
7
35
Sample EmpGroup Table data:
----------------------------
Empid GroupId
5 3
6 3
7 3
5 4
6 4
8 4
====================================
I would like to have the records like
Empid GroupId
5 3
6 3
7 3
Records for empidid=5,6,8 and groupid=4 under empgroup table shouldnt be listed as empid =8 is missing in Employees.empid
How can i write a program or query to get the results as in my sample records result?
Any help appreciated
Thanks
Gk