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

Explain what is the difference between union and union all?

1070


What is partition, how will you implement it? : sql server analysis services, ssas

1099


Explain in details security in SQL azure?

123


What objects does the fn_my_permissions function reports on? : sql server security

1084


What is the difference between varchar and varchar types?

1118


What is a View ? Can we insert, Update and delete a view?

1059


How can you find out if the current user is a member of the specified microsoft® windows nt® group or microsoft sql server™ role?

1081


How you would rewrite the sql query to return the customerid sorted numerically?

1046


What is the use of custom fields in report?

1041


What is bcp? When does it used?

1042


List the different types of collation sensitivities in sql server?

1076


Does partitioning help performance?

995


What is tempdb database? : SQL Server Architecture

1256


Explain what is it unwise to create wide clustered index keys?

1023


Explain difference between cross join and full outer join?

1065