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

What are the types of normalization?

972


What do you understand by replication in sql server?

996


Tell me what is the order in which the sql query is executed?

900


What is transaction server auto commit?

990


Explain candidate key, alternate key, and composite key?

942


How to insert data with null values?

971


What is spid in sql server profiler?

1028


How do indexes help, types?

910


What is bit data type?

980


Explain the properties of the relational tables?

940


What are the properties and different types of sub-queries?

961


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

1137


Explain the commands in sql server?

969


What happens if the update subquery returns no rows in ms sql server?

1075


What are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security

935