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 / pradip jain
select sname from (select Row_Number() over (partition by
sname
order by sname) as ROWNO,sname from student) p
order by ROWNO,sname desc
only change table name same as bobby
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain throw statement in sql server 2008?
Can we insert data into a view?
What is read committed?
How many partitions a clustered index has by default in sql server 2012?
What is difference between table aliases and column aliases? Do they affect performance?
what is bit datatype and what's the information that can be stored inside a bit column? : Sql server database administration
Explain tables in SQL Azure?
What is indexed view?
What are wait types?
Which are the third-party tools used in sql server and why would you use them?
Can you name some of the dml commands in sql?
What are dml (data manipulation language) statements in ms sql server?
How many types of stored procedures are there in sql server?
What is the use of sql profiler in sql server 2012?
Why does sql studio use a single registered database repository? : sql server management studio