Query to Find Duplicate value in SQL

Employee table


SELECT *FROM employees where first_name='Peter';

How to find Duplicate value in SQL

SELECT first_name,count(first_name)
from employees
group by first_name 
having count(first_name)>1;

Output

Leave a Reply

Your email address will not be published. Required fields are marked *