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 / murthy
select e.name from
(select *,row_number() over (partition by name order by
name) as Rw from #T1) e
order by e.Rw,name desc
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain what is the difference between union and union all?
What is partition, how will you implement it? : sql server analysis services, ssas
Explain in details security in SQL azure?
What objects does the fn_my_permissions function reports on? : sql server security
What is the difference between varchar and varchar types?
What is a View ? Can we insert, Update and delete a view?
How can you find out if the current user is a member of the specified microsoft® windows nt® group or microsoft sql server™ role?
How you would rewrite the sql query to return the customerid sorted numerically?
What is the use of custom fields in report?
What is bcp? When does it used?
List the different types of collation sensitivities in sql server?
Does partitioning help performance?
What is tempdb database? : SQL Server Architecture
Explain what is it unwise to create wide clustered index keys?
Explain difference between cross join and full outer join?