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
How to join two tables in a single query in ms sql server?
explain different types of backups avaialabe in sql server? : Sql server database administration
What are trace flags and mention a few common trace flags used with sql server?
How to get a list of table columns using the "sp_columns" stored procedure in ms sql server?
What are the dmvs?
What is the main purpose of having conversation group?
you have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem? : Sql server administration
What is the order by used for?
What is a system database and what is a user database?
What are different replication agents and what's their purpose? : sql server replication
What are the requirements on sql server network connections?
Write a sql query to display the current date?
What does the on delete cascade option do?
How do you improve the performance of a SQL Azure Database?
Do you know what guidelines should be followed to help minimize deadlocks?