Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Explain different types of BACKUPs avaialabe in SQL Server? Given a particular scenario, how would you go about choosing a backup plan?

1086


Suppose you want to implement the following relationships while designing tables. How would you do it?a.) One-to-oneb.) One-to-manyc.) Many-to-many

984


can an automatic recovery be initiated by a user? : Sql server administration

991


How to use subqueries with the exists operators in ms sql server?

1175


How many levels of sp nesting are possible?

1067


How to insert multiple rows with one insert statement in ms sql server?

1178


What is difference between clustered and non clustered index?

1032


How to create function without parameter in sql server?

1105


What structure can you implement for the database to speed up table reads?

1232


What is the syntax to execute the sys.dm_db_missing_index_details? : sql server database administration

1199


What is use of except clause?

1139


Is null vs coalesce?

927


Explain logical operators in sql server?

1181


How to use column default values in insert statements in ms sql server?

1097


What happens if null values are involved in arithmetic operations?

1046