View previous topic :: View next topic
|
Author |
Message |
abraralum
New User
Joined: 19 Dec 2010 Posts: 42 Location: Bangalore
|
|
|
|
Hi..
I am looking for some pointers here please ...
EMP_ID EMP_NM EMP_Project_ID
1 XXX 888
1 XXX 999
1 XXX 777
I will have to fetch the records of the employee only if the employee is working for more than one project.... i.e, my query shoud satisfy teh condition
EMP_ID = 1,
EMP_NM = 'XXX',
Row count (EMP_Project_ID) > 0
Please advise how can I place the last condition in Sql query. |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
Code: |
SELECT EMP_ID, EMP_NM , COUNT(*)
FROM EMP
GROUP BY EMP_ID, EMP_NM
HAVING COUNT(*) > 1
WITH UR;
|
|
|
Back to top |
|
|
|