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 / inderpal

Select empname, salary from A order by empname

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is a default tcp/ip socket assigned for sql server? : Sql server database administration

548


Differentiate between ms sql server reporting services vs crystal reports?

504


How to execute a sql statement using mssql_query()?

553


What are the recovery models for a database?

627


what is blocking? : Sql server database administration

514






What is the use of custom fields in report?

570


What is PROJECTION Operation?

617


List the different index configurations possible for a table?

524


Is t sql the same as sql server?

526


What is difference between unique and primary key?

487


Why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it?

509


What is ddl command?

540


What is the difference between drop table and truncate table?

497


What is blocking and how would you troubleshoot it? : sql server database administration

602


Explain rdbms?

611