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 / kuntal
select * from A where empname in (select empname from A
group by empname having COUNT(*)>1)
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What are the underflow and overflow behaviors on float literals?
What is not null constraint?
If user is owning any SQL Objects, can we drop that user
What happens if null values are involved in arithmetic operations?
Retrieve the unique rows from table without using UNIQUE and DISTINCT keywords.
Why are you getting errors when creating a new odbc dsn?
Define candidate key, alternate key, and composite key.
What is a transact-sql statement batch in ms sql server?
What is SQL Azure Data sync?
What is the difference between inner join and equi join?
Do you know the capabilities of cursors?
What is efficiency data?
Why use “in” clause in sql server?
Is it important for a database administrator to understand the operating system and file access?
What is Federation and Federation Member?