Hi,

I have a table A which has four rows as follows

Table A
-------

empname salary
------- ------
A 1000
B 2000
C 3000
A 1000
B 2000
D 5000

I need the following output:

empname salary
------- ------
A 1000
A 1000
B 2000
B 2000

Thanks in advance

Answer Posted / vinay

select empname , salary
from A
where empname in (select name from A group by empname
having count(empname ) > 1)
order by empname

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is use of except clause? How does it differ from not in clause?

730


State the difference between local and global temporary tables?

791


How to convert numeric values to integers in ms sql server?

697


What is snapshot parameter in ssrs?

124


How to create an identity column?

848






i have made a project i vb.net n created a .exe of it after installing it in to any pc, the database (sql express) is not geting accesed i.e the aplication cuts the link of the database, so plz help in this matter.

1572


Does windows server 2016 come with sql server?

677


What is the difference between sql server 2000 object owner and sql server 2005 schema? : sql server database administration

758


What is built-in function?

702


Explain cross join or cartesian product in sql?

698


What do you understand by physical_only option in dbcc checkdb?

747


How many types of functions are there in sql server?

604


What is apply operator in sql?

758


How do I open port 1433?

694


What is a select query statement in ms sql server?

760