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 emp , Fields with empname,dnname,dno,salary.
now I want copy distinct salary with all emp detail from emp into new table which is not already exist in database. how would I do this ?

Answer Posted / b.kumar

WITH CTE
AS
(
SELECT *, ROW_NUMBER() OVER (PARTITION BY SAL ORDER BY SAL) AS ROWID
FROM EMP7
) SELECT * INTO EMP10 FROM CTE WHERE ROWID=1

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain different forms of normalization?

1003


What is the default order of an order by clause?

1039


What are the differences between char and nchar in ms sql server?

1144


How you trouble shoot when any job fails

1984


What command would you use to create an index?

1110


Can you explain what is the use of custom fields in report?

1102


How to connect sql server management studio express to sql server 2005 express?

1103


in the physical file layout, where should the transaction log be stored in relation to the data file?

1044


What is 5nf in normalization form?

1046


How to concatenate two character strings together?

1170


hi i am working as a testengineer , so i want to no the backend data base connection can any one tell mwe in detail

2276


what does the automatic recovery do? : Sql server administration

1081


What is cached report?

150


What is a benefit of using an after insert trigger over using a before insert trigger?

1034


When I run the sql server 2000 setup, it just hangs. What do I do?

1129