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 / enis ertem
Select emp.empname, emp.salary from employee emp join (
select empname, salary from employee emp
group by empname, salary
having count(empname) > 1) as tbl
on emp.empname = tbl.empname
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How to replace given values with null using nullif()?
What is the name of the system variable that returns the number of rows affected by a SQL statement?
Write a program using SQL queries to find a unique entry in a table.
What are the 2 types of classifications of constraints in the sql server?
How do you create type- insensitive operator?
How to download microsoft sql server 2005 express edition?
What are the types of database schema? : sql server analysis services, ssas
What is an etl file?
What are sql azure firewall rules?
What are pages and extents? : SQL Server Architecture
Why should we go for stored procedures? Why not direct queries?
What’s the use of custom fields in report?
explain the storage models of olap? : Sql server database administration
What is a rownum?
What is a not null constraint?