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 ?
Answers were Sorted based on User's Feedback
Answer / prashant
SELECT DISTINCT empname,dnname,dno,salary into New Table
from emp
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / 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 |
How to provide default values to stored procedure parameters?
What is excution Plan in sql server
1 Answers CarrizalSoft Technologies, TCS,
explain what are the steps you will take, if you are tasked with securing an sql server? : Sql server database administration
What is scrollable cursor?
What is the purpose of the model database?
What is named calculation? : sql server analysis services, ssas
What is store procedure? How do they work? When do you use?
What is a partition key?
Explain sub-query?
What are the advantages to use stored procedures?
How do I partition a table in sql server?
explain declarative management framework (dmf) in sql server 2008?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)