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
How do I find the port number for sql server?
What is the difference between the 2 operating modes of database mirroring?
What is recompile sql server?
Can we insert data into view sql server?
What are different types of replication in sql server?
What is surrogate key? : sql server analysis services, ssas
What are the different types of locks in the database?
Explain what is the difference between a local and a global temporary table?
How to use union to merge outputs from two queries together in ms sql server?
What is the main purpose of having conversation group?
How can you manage sql azure security?
Explain about nested stored procedure?
Explain activity monitors
How to delete multiple rows with one delete statement in ms sql server?
Why use “nolock” in sql server?