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
What is row_number function?
What is sql server locking?
What is a scheduled job or what is a scheduled task?
What is the chart in report?
what type of index will get created after executing the above statement? : Sql server database administration
What is Federation and Federation Member?
Detail about query optimizer?
What are ddl (data definition language) statements for tables in ms sql server?
Can a synonym name of a table be used instead of a table name in a select statement?
What is pivot and unpivot?
tell me the disaster recovery plan
How to add an address record into adventureworkslt?
How to create hyperlink from returned sql query ?
What is the use of floor function in sql server?
Can you change the data type of a column in a table after the table has been created? If so, which command would you use?