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 tablesample?

980


It is important form e to get the information from log files of applications executed by the task scheduler? Does sql studio save these log files? : sql server management studio

1009


What are the kinds of subquery?

998


What is replace and stuff function in sql server?

1050


How to set database to be single_user in ms sql server?

1009


Explain about sql server login?

1065


Explain datetime2 data type in sal server 2008?

896


Determine how to use the inserted and deleted pseudo tables?

972


What are the different normalization forms?

1086


How each E-R model constructs can be mapped to the relational model?

984


What are the dmvs?

999


What is a partition key?

933


How to convert numeric expression data types using the cast() function?

1046


How to restore performance issues and how to check?

1986


What is the maximum size of a dimension? : sql server analysis services, ssas

1025