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

Does union all remove duplicates?

1070


what is a schema in sql server 2005? : Sql server database administration

1034


what happens on checkpoint? : Sql server database administration

1109


How can I check if a view exists in a sql server database?

1040


What are synonyms?

965


Explain the dirty pages?

1011


How to find tables without indexes?

1090


How to invoke a trigger on demand?

1094


how to trace the traffic hitting a sql server? : Sql server database administration

1882


What are the types of indexing?

1084


What do you mean by sql server agent?

997


What is temporal data type?

925


What is sql server used for?

1057


What is sql server profiler trace data file?

1114


Explain the truncate command? : SQL Server Architecture

1176