How reterive duplicate value in SQL?

Answer Posted / justus

create table emp

empid empname
----- --------
101 a
102 b
103 a
104 c
105 a

select empname from emp group by empname having count(empname)>1

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration

550


Does group by or order by come first?

536


List all types of constraints in sql server?

511


What happens if you are trying to access a schema not owned by you?

508


Explain the steps needed to create a scheduled job?

521






What Is Rdbms?

671


What are group functions in query statements in ms sql server?

549


How to enable/disable indexes?

588


Ms sql server index?

535


How do I run a trace in sql server?

497


Which are the important points to note when multilanguage data is stored in a table?

510


What types of Joins are possible with Sql Server?

539


What is difference between equi join and natural join?

535


How to include text values in sql statements?

580


What will be the value of @@fetch_status if a row that was a part of the cursor resultset has been deleted from the database after the time the stored procedure that opened the cursor was executed?

646