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

what is denormalization and when would you go for it? : Sql server database administration

1118


What is the Difference Between Primary and Foreign Key?

960


Explain what are the authentication modes in sql server?

950


What is an identity?

939


Does group by or order by come first?

900


When would you use the stored procedures or functions?

950


Does partitioning improve performance sql server?

899


What does it mean to be in union?

873


Explain “@@rowcount” and “@@error” in sql server?

1007


What is the maximum number of index per table?

1017


what are the different types of SSRS reports?

146


How to apply filtering criteria at group level with the having clause in ms sql server?

947


What is sql server agent and what are the two modes of authentication in sql server?

996


What is indexing a document?

970


Explain microsoft sql server functions?

1036