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
What are the different types of sub-queries?
Explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?
Explain Geometry datatype in sql server 2008 with example
How to view existing indexes on an given table using sys.indexes?
do you know how to configure db2 side of the application? : Sql server database administration
What is the difference between a primary key and a unique key? Are they the same?
What are the components of sql server service broker?
You want to use bids to deploy a report to a different server than the one you chose in the report wizard. How can you change the server url?
Does union all remove duplicates?
What is implicit cursors?
How do I find the sql server database version?
What is auditing in sql server?
What are the differences between having and where clause.
List out the differences between the clustered index and non-clustered index in sql server?
What does indexation mean?