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 / sagun sawant
;with TEST as (select Row_Number() over (partition by sname
order by sname) as ROWNO,sname from student)
select sname from TEST order by ROWNO,(case when sname
= 'RAM' then 1
when sname = 'RAJ' then 2 end)
| Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
What is indexing explain it with an example?
What is difference between createstatement and preparedstatement?
What is the maximum size of column in sql server?
What is a heap?
Why truncate is ddl command?
Do you know nested transaction?
List the advantages of using stored procedures?
What is difference between order by and group by?
What are truncate options available in sql server? : sql server database administration
What specific conditions database should meet, before you can bulk copy data into it using bcp?
What are 3 ways to get a count of the number of records in a table?
What is order of B+tree?
What is the difference between system objects and user objects?
What is Replication?
What are horizontal and vertical scaling?