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
How to convert character strings into numeric values?
What languages bi uses to achieve the goal?
Do you know sql server 2008 introduces automatic auditing?
How to deploy the Report?
How to create function with parameter in sql server?
Do you know sql server 2008 backup compression?
How to change the password of a login name in ms sql server?
What is the concept of optimization?
Do you know how to implement service broker?
Is truncate autocommit?
What is RMS migrations?
What is coalesce and check constraint in sql server?
how many triggers you can have on a table? : Sql server database administration
How to transfer an existing table from one schema to another schema in ms sql server?
Explain following error properties?