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

Explain throw statement in sql server 2008?

931


Can we insert data into a view?

1062


What is read committed?

1007


How many partitions a clustered index has by default in sql server 2012?

1050


What is difference between table aliases and column aliases? Do they affect performance?

910


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

928


Explain tables in SQL Azure?

120


What is indexed view?

927


What are wait types?

1019


Which are the third-party tools used in sql server and why would you use them?

843


Can you name some of the dml commands in sql?

961


What are dml (data manipulation language) statements in ms sql server?

924


How many types of stored procedures are there in sql server?

952


What is the use of sql profiler in sql server 2012?

841


Why does sql studio use a single registered database repository? : sql server management studio

952