i have a table student like
sname
-----
ram
ram
ram
raj
raj
raj
i need the output like
sname
-----
ram
raj
ram
raj
ram
raj
Answer Posted / pradip jain
select sname from (select Row_Number() over (partition by
sname
order by sname) as ROWNO,sname from student) p
order by ROWNO,sname desc
only change table name same as bobby
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to convert numeric expression data types using the cast() function?
Explain the disadvantages of cursors?
what are defaults? Is there a column to which a default can't be bound? : Sql server database administration
What is federation member?
Do you know hot add cpu in sql server 2008?
How to find the list of fixed hard drive and free space on server?
Explain what is dbcc?
What is SubQuery in SQL Server 2008
what is a major difference between sql server 6.5 and 7.0 platform wise? : Sql server database administration
What is normalization and denormalization in sql server?
What is the use of “join” in sql server?
What are sub reports?
What does the on update no action do?
Using the customer, and order table in northwind database, please write a query to produce xml?
Explain what are the events recorded in a transaction log?