How reterive duplicate value in SQL?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / sivasiva
create table emp
empid empname
----- --------
101 a
102 b
103 a
104 c
105 a
select empid from emp groupby empid,empname having count>1
| Is This Answer Correct ? | 17 Yes | 12 No |
Answer / satishkulala
select empname from emp group by empname having count(empname)>1
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / rajesh.a
select count(*),empname from emp group by empname having count(*)>1
| Is This Answer Correct ? | 4 Yes | 0 No |
create table emp (empid int,empname varchar)
insert into emp values (101,'a')
insert into emp values (102,'b')
insert into emp values (103,'a')
insert into emp values (104,'c')
insert into emp values (105,'a')
select * from emp
SELECT EmpName,Count(EmpID)Cnt From Emp Group By EmpName
Having Count(EmpName) > 1
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / ashish jain
create table emp
empid empname
----- --------
101 a
102 b
103 a
104 c
105 a
select empname from emp where count(empname)>1
| Is This Answer Correct ? | 6 Yes | 10 No |
Why is there a performance difference between two similar queries where one uses union and the other uses union all?
How sql server executes a statement with nested subqueries?
explain different types of constraints? : Sql server database administration
What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?
11 Answers World Tech, Yardi Software,
as a general practice, it is recommended to have dbo be the owner of all database objects however, in your database you find number of tables owned by a user other than dbo, how could you fix this? : Sql server administration
what is meant by deafult in sql server?
How to disable a login name in ms sql server?
How to create an inline table-valued function?
What is a cube? : sql server analysis services, ssas
Explain a checkpoint?
How to start sql server browser service?
What is sql server 2000 work load governor?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)