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 is apply operator in sql?
Distinguish between nested subquery and correlated subquery?
Explain about builtinadministrator?
What is the recovery model?
Why transaction is important?
What is 2nf in normalization?
How can delete duplicate records in cte in sql server?
Is it possible to import data directly from t-sql commands without using sql server integration services? If so, what are the commands?
explain declarative management framework (dmf) in sql server 2008?
Do you know what is a with(nolock)?
Explain the different index configurations a table can have?
What do you mean by tablesample?
Can we write a distributed query and get some data which is located on other server and oracle database?
Hi, I Created 3 Tables Person(PersID[prkey],Name,Email,Password), Project(ProjName,ProjID[prkey],ProjLeader,ProjManager) & ProjectInvolvement(EntryDate,ProjID[frkey],PersID[frkey],ProjDuration). For this how can i INSERT,UPDATE & DELETE Through PROCEDURE? Please Post the Answer for me. Desai.
Tell me what are cursors and when they are useful?