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 different forms of normalization?
What is the default order of an order by clause?
What are the differences between char and nchar in ms sql server?
How you trouble shoot when any job fails
What command would you use to create an index?
Can you explain what is the use of custom fields in report?
How to connect sql server management studio express to sql server 2005 express?
in the physical file layout, where should the transaction log be stored in relation to the data file?
What is 5nf in normalization form?
How to concatenate two character strings together?
hi i am working as a testengineer , so i want to no the backend data base connection can any one tell mwe in detail
what does the automatic recovery do? : Sql server administration
What is cached report?
What is a benefit of using an after insert trigger over using a before insert trigger?
When I run the sql server 2000 setup, it just hangs. What do I do?