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
What command do we use to rename a database?
What is difference between after and before?
Recommend an approach to ensuring that all changes in the remote databases synchronize with the SQL Azure database?
What is the difference in accessing db between sql server vs sql azure?
Explain the xml support sql server extends?
What are the difference between data mart and data warehouse? : sql server analysis services, ssas
What is 'Join' and explain its various types.
List the types of recovery model available in sql server?
Why is there a performance difference between two similar queries where one uses union and the other uses union all?
Can a database be shrunk with users active?
Benefits of Stored Procedures?
What is the difference between varchar and nvarchar datatypes?
How should i optimize the time for execution of stored procedure having single input and many output from the different tables?
What are the basic functions for master, msdb, model, tempdb and resource databases?
How do you trace the traffic hitting a sql server?