how to copy only distinct data into another table which is not already exist in database?
Answer Posted / karthik soundararajan
TableA -- Existing Table
ID
5
5
5
5
5
Solution : SELECT DISTINCT ID INTO TableB FROM TableA
It create a table called TableB and insert only one record as shown below:
ID
5
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Explain the ways to controlling cursor behavior?
What is collation sensitivity? Explain different types.
What is database mirroring?
Is it possible to update the views? If yes, how, if not, why?
Why union all is faster than union?
What is the difference between Stored Procedures and triggers?
Explain the characteristics of a transaction server for example atomicity, consistency, isolation, durability?
What is the difference between a clustered index and a non-clustered index?
Tell me what is sql profiler?
What is the difference between truncate and delete commands?
How ssrs maintain security?
Is profiler the only tool that has the ability to audit and identify ddl events? : sql server security
What are horizontal and vertical scaling?
Define msdb database?
List the different normalization forms?