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

select e.name from
(select *,row_number() over (partition by name order by
name) as Rw from #T1) e
order by e.Rw,name desc

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 access the deleted record of an event?

1015


what is difference between view and Dip.

2396


How do I run a trace in sql server?

967


How do use Having,Group by,Group function in SQL?

1722


what types of replication are supported in sql server? : Sql server database administration

1017


How do I open port 1433?

915


What is resource governor in sql server?

973


What extended events?

988


What is dirty page?

952


How to perform key word search in tables?

947


How to find Duplicate Records In table?

1000


What is nonclustered index with included columns ?

945


1 01 101 01010

2035


Can you explain various data region available in ssrs with their use?

959


Define cursor locking

980