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

What is a cache in ssrs?

140


Explain the phases a transaction has to undergo?

1115


Define right outer join in sql server joins?

1112


Explain rdbms?

1080


Write a SQL query to delete a table?

1186


what's the information that can be stored inside a bit column? : Sql server database administration

1091


List out the difference between union and union all in sql server?

1043


Does partitioning ssd reduce performance?

930


Where can you add custom error messages to sql server?

1164


What is nonclustered index on computed columns?

1000


What it means to be triggered?

1082


Describe in brief system database.

1075


How to maintain a fill factor in existing indexes?

1057


What is DCL?

1104


What is a not null constraint?

1088