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
explain what is raid and what are different types of raid configurations? : Sql server database administration
What are the new security features added in sql server 2012? : sql server security
what are constraints? Explain different types of constraints? : Sql server database administration
What are different types of database indexes?
What is the difference between update lock and exclusive lock?
How many types of local tables are there in sql server?
Can you explain what is the use of custom fields in report?
Explain important index characteristics?
What are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security
What are the steps to take to improve performance of a poor performing query? : sql server database administration
Are semicolons required at the end of sql statements in sql server 2005?
How to create a new schema in a database?
on line cluster can we make if yes tell me the procedure
What are the five characteristics of good data?
What is collation sensitivity?