Click here to Skip to main content
15,920,633 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Given a table of records with empID, contact number; write a query to print empIDs who have multiple phone numbers


What I have tried:

Select empID frm tblEmp having(contactNum) > 1

Assuming tblEmp is our table.
Tried to get the data with above query but its not working... 
Posted
Updated 29-Jan-18 20:14pm
Comments
[no name] 30-Jan-18 2:15am    
Please mention your table schema with some records in your question and use Improve question link to modify your question.

1 solution

try
Select empID from  tblEmp group by empId having count(*)  > 1

refer the syntax
SQL GROUP BY Statement[^]
SQL HAVING with GROUP BY | Examples[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900