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
How to rename an existing table with the "sp_rename" stored procedure in ms sql server?
How except clause is differs from not in clause?
What is page-level compression?
What is bcp? When does it used?
Why is normalisation important?
Define magic tables in sql server?
Delete duplicate rows without using rowid.
What is the difference between count and distinct count?
What are filegroups in sql server?
How to find related tables in sql server?
How to find tables without indexes?
What is bit data type? What's the information that can be stored inside a bit column?
What are database states in ms sql server?
While migrating Microsoft SQL Server 2008 database to SQL Azure, what can be done to ensure the database connectivity does not degrade?
What is difference between materialized view and view?