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 catalog views?
What is page in sql server?
What are the different types of columns types constraints in the sql server?
What is a join in sql? What are the types of joins?
Explain the creation and execution of a user-defined function in the sql server?
How to convert binary strings into integers in ms sql server?
What does <> symbol mean?
How to use subqueries with the in operators in ms sql server?
What is triggers and stored procedures?
What is the web service used for reporting services?
Explain the dirty pages?
What is the difference between online clustering and Offline clustering?
What are data regions?
What is Dependency Injection and provide example?
What is BCP? When does it used in sql server 2012?