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 the difference between stored procedure and user defined functions?
What do you mean by subquery?
What is partitioned view?
What are the benefits of normalization?
What is the difference between varchar and nvarchar datatypes?
What are the two modes of authentication in sql server?
How to insert stored procedure result into temporary table?
Explain what you mean by 3 tier architecture.
How to set a database state to offline in ms sql server?
How to perform backup for certificates in sql server? : sql server security
What is for xml in sql server?
What are the encryption mechanisms in sql server?
What is a partition key?
What is a matrix in ssrs?
Explain the purpose of indexes?