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
|Is This Answer Correct ?||3 Yes||2 No|
Answer / b.kumar
SELECT *, ROW_NUMBER() OVER (PARTITION BY SAL ORDER BY SAL) AS ROWID
) SELECT * INTO EMP10 FROM CTE WHERE ROWID=1
|Is This Answer Correct ?||1 Yes||0 No|
Advantages and disadvantages of stored procedures.
how to find out the repeated value from table using groupby function?
What are three SQL keywords used to change or set someone?s permissions?
explain different types of jions with examples briefly?
I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that
Delete duplicate rows from a table without primary key by using a single query Table Employee empname salary A 200 B 300 A 200 C 400 D 500 D 500 Output should be A 200 B 300 C 400 D 500
SQL stops working in every 15 days displaying message that database log file is full. Log file size is 3.95 GB. It is happening after shrinking the database also. What is solution to overcome this problem. Please help me as it's urgent.
What is the difference between UNION and UNIONALL?
What is difference between stored procedure and function?
What are the types of indexes available with SQL Server?
how to retrive only second row from table in sql server 2000?
About types of indexes in SQL server ?