How reterive duplicate value in SQL?

Answers were Sorted based on User's Feedback



How reterive duplicate value in SQL?..

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

How reterive duplicate value in SQL?..

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

How reterive duplicate value in SQL?..

Answer / satishkulala

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

Is This Answer Correct ?    5 Yes 0 No

How reterive duplicate value in SQL?..

Answer / rajesh.a

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

Is This Answer Correct ?    4 Yes 0 No

How reterive duplicate value in SQL?..

Answer / jaleel ahamed s

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

How reterive duplicate value in SQL?..

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

Post New Answer

More SQL Server Interview Questions

What are the different authentication modes in sql server? How can it be changed?

0 Answers  


What is store procedure? How do they work?

0 Answers  


Does sql server 2016 have ssms?

0 Answers  


What is difference between cte and view?

0 Answers  


How to use transact-sql statements to access the database engine?

0 Answers  






What is Inner Join?

2 Answers  


What is temporary table in sql server? Why we use temp table?

0 Answers  


What happens if you delete a table that is used by a view?

0 Answers  


What is the difference between createstatement and preparedstatement?

0 Answers  


What are the difference between “where” and “having” clause in sql server?

0 Answers  


In my application I have a process which picks the scanned files (tif format) from a shared location and it links to application and shown on it.The actuall issue is that my process picks the file before it is completly written or scanned which results in displaying few parts of the image or incomplete image.I need to check if the file is not completly scanned or written then do not link it to application.Please help if any body tell me that how can i check that file is in written phase or locked through DTS.thanking you in advance

0 Answers  


Explain how many normalization forms?

0 Answers  


Categories