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
As a general practice, it is recommended to have dbo be the owner of all database objects however, in your database you find number of tables owned by a user other than dbo, how could you fix this?
What is the maximum length of an alert name?
What is difference between delete and truncate commands?
The external application that is executed in one of the tasks does not have a log file, but only a screen log. How can I save the data from the screen? : sql server management studio
How to list all tables in the database using odbc_tables()?
what method you can use to reduce the overhead of Reporting Services data sources?
What is purpose of normalization?
How will you hide an attribute? : sql server analysis services, ssas
How to write an inner join with the where clause in ms sql server?
What are system databases in ms sql server?
What is row-level compre?
When does a workload on SQL Azure get throttled?
Does dbcc checkdb requires db to be in single_user mode? : sql server database administration
Explain the categories of stored procedure?
What are various ways to enhance the ssrs report?