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 page-level compression?
What is data block and how to define data block size?
What are click through reports?
What do you understand by the data quality services in sql server?
What is the use of sign function?
what is the system function to get the current user's user id? : Sql server database administration
after migrating the dts packg to ssis by using migrtn wizrd in 2005. iam not able to open ssis pack and getting error. what r those errors? how to resolve?
How much does sql server 2016 cost?
you accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover? : Sql server administration
Can primary key be a foreign key?
How to copy data from one table to another table?
What is normalization? Explain different forms of normalization?
After removing a table from database, what other related objects have to be dropped explicitly?
How to insert multiple rows with one insert statement in ms sql server?
What is the openxml statement in sql server?