i want only duplicates rows from coloumn
ex. emp_id(colomn name)1,1,2,3,3,4,5,5.

so i want only duplicates no.

Answer Posted / chinna_g

You have 'emp' table with empid,empname,empsal.
With values:
1 row:1,'hhh',10000
2 row:2,'nnn',10000
3 row:3,'vvv',15000
4 row:4,'jjj',10000

A)
In this table you have sal column 10000 repeating 3 times
in the table, if you want to retrieve the repeated values
i.e. the salary column with 3 times to be displayed in the
following query:

"select empsal from emp where empsal in(select empsal from
emp group by empsal having count(empsal)>1);"

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where sql server usernames and passwords are stored in a sql server?

489


What is open database communication (odbc)?

567


What are information schema views?

546


can an order by clause be used in a creation of a view?

690


What are temporal tables in sql server 2016?

474






What is sharding?

88


Suggest a method of joining two tables.

598


Can we use where clause with group by?

514


what's new in sql server 2016?

555


Please explain the characteristics of a transaction server for example atomicity, consistency, isolation, durability?

492


What is fill factor and pad index?

536


You accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover?

543


What is a sql join?

570


Explain the truncate command? : SQL Server Architecture

562


Explain indexing and what are the advantages of it?

520