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
What is difference between line feed ( ) and carriage return ( )?
What is key attribute?
between cast and convert which function would you prefer and why?
Do you know the capabilities of cursors?
What are the differences between decimal and float in ms sql server?
What is standby servers? Explain types of standby servers.
How to use subqueries with the in operators in ms sql server?
How to modify an existing user defined function?
What are transactions in sql?
What is lookup override?
What is the security principal at the server level that represents your session?
Create and insert into temp table in sql server?
I have all the primary data files, secondary data files as well as logs. Now, tell me can I still restore the database without having a full backup? : sql server database administration
What are the instances when triggers are appropriate?
Is it possible to call a stored procedure within a stored procedure?