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 / anand

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

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How sql server enhances scalability of the database system?

777


What is the difference between value type and reference type?

707


Define left outer join?

756


What is usually the first word in a sql query?

812


What are different types of statement?

667






Define normalisation?

865


When I run the sql server 2000 setup, it just hangs. What do I do?

796


What is the use of for clause?

768


What stored by the model?

717


Can you move the resources after pausing the node? : sql server database administration

767


What is sql server profiler trace data file?

783


What does sql server mean?

693


Is foreign key unique?

744


What is mean by clustered index and non clustered index, give syntax of creation? : sql server database administration

780


What are the different acid properties?

804