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 / bobby

select ename from (select Row_Number() over (partition by
ename
order by ename) as ROWNO,ename from emp) p
order by ROWNO,ename desc

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

please differentiate between delete and truncate?

732


What is ddl and dml commands?

662


What are magic tables in sql server?

786


How do I start sql server 2017?

698


What are data resources?

659






What is full outer join in sql server joins?

732


What is a livelock?

719


What is the use of custom fields in report?

759


What is the difference in accessing db between sql server vs sql azure?

166


How to list all user names in a database?

775


What are the elements of dbms?

711


What is ms sql server index?

743


Explain full-text indexing?

693


Is it possible to run multiple publications and different type of publications from the same distribution database? : sql server replication

735


What is RMS migrations?

1884