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
What is collation sensitivity? Explain different types.
What is clustered vs nonclustered index?
How to backup SQL Server Reporting Services ?
How to create a user name in a database?
Can a trigger be created on a view?
What is SubQuery in SQL Server 2008
What is SQL Azure Data sync?
Where do you find the default Index fill factor and how to change it?
What is a partition function in sql server?
Name few endpoints exposed by ssrs 2012?
Explain the concept of view and Types of views in SQL server?
Describe triggers features and limitations?
How does stuff differ from the replace function?
how to trace the traffic hitting a sql server? : Sql server database administration
How do I start sql server?