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


Please Help Members By Posting Answers For Below Questions

How to convert numeric expression data types using the cast() function?

1074


Explain the disadvantages of cursors?

1146


what are defaults? Is there a column to which a default can't be bound? : Sql server database administration

1142


What is federation member?

116


Do you know hot add cpu in sql server 2008?

961


How to find the list of fixed hard drive and free space on server?

1205


Explain what is dbcc?

1015


What is SubQuery in SQL Server 2008

1028


what is a major difference between sql server 6.5 and 7.0 platform wise? : Sql server database administration

912


What is normalization and denormalization in sql server?

1021


What is the use of “join” in sql server?

1104


What are sub reports?

204


What does the on update no action do?

1033


Using the customer, and order table in northwind database, please write a query to produce xml?

1082


Explain what are the events recorded in a transaction log?

1008