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 / prashant

SELECT DISTINCT empname,dnname,dno,salary into New Table
from emp

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what types of replication are supported in sql server? : Sql server database administration

455


What is a join in sql? What are the types of joins?

515


Is mysql the same as sql server?

503


What is Fragmentation and Defragmentation? For 32GB Table,How can we do the fragmentation?

3749


How to list all columns in a table using odbc_columns()?

531






Explain in brief about Microsoft SQL server?

538


How to rebuild all indexes on a single table?

577


What is the use of attributehierarchyvisible ? : sql server analysis services, ssas

564


What is the difference between local and global temporary tables?

577


How real and float literal values are rounded?

578


Write a query to include a constraint, to check whether the employee salary is greater than 5000?

1108


Differentiate between mongodb vs. Sql server?

572


What is difference between join and natural join?

471


what is database replicaion? : Sql server database administration

600


Is the order of columns in the set clause important in ms sql server?

513