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 what is raid and what are different types of raid configurations? : Sql server database administration

1008


What are the new security features added in sql server 2012? : sql server security

1032


what are constraints? Explain different types of constraints? : Sql server database administration

996


What are different types of database indexes?

1108


What is the difference between update lock and exclusive lock?

984


How many types of local tables are there in sql server?

936


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

1063


Explain important index characteristics?

1044


What are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security

992


What are the steps to take to improve performance of a poor performing query? : sql server database administration

1057


Are semicolons required at the end of sql statements in sql server 2005?

998


How to create a new schema in a database?

1160


on line cluster can we make if yes tell me the procedure

2027


What are the five characteristics of good data?

923


What is collation sensitivity?

1075