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
What are the hotfixes and patches in sql server?
What is resource db in sql server?
Explain various data region available in ssrs with their use?
How to write a query with a left outer join in ms sql server?
Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?
What are the encryption mechanisms in sql server?
Why is the need for data conversion transformations?
What do you understand by the denormalisation?
how can you select rexcord(rows) from table A which is not present in Table B . Id being the FK in Table B referencing to ID Table A
What is the difference between Triggers and Stored Procedure?
what is a self join? : Sql server database administration
You want to check the syntax of a complicated update sql statement without executing it. What command should you use?
is it important for a database administrator to understand the operating system and file access? : Sql server administration
What is difference between order by and group by?
How do I find the size of a sql server database?