how to copy only distinct data into another table which is not already exist in database?
Answers were Sorted based on User's Feedback
Answer / 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 |
SELECT DISTINCT * INTO TABLE_NEW FROM TABLE_EXISTING
Is This Answer Correct ? | 1 Yes | 0 No |
write a query to remove duplicate records without using primary key column?
What is the difference between MVC and Teir Architecher? Plz explain with Layyered Programming example...? Thanks
What is the difference between ROW_NUMBER and Ranking function in SQL SERVER?
What are the different types of collation sensitivity?
How to create a local temporary stored procedure?
How to list all user defined functions in the current database?
Explain mixed authentication mode of sql server?
Can you explain powershell included in sql server 2008?
Can you give an example of Stored Procedure?
Explain indexed views and partitioned view with their syntax.
What are the hotfixes and patches in sql server?
What is the contrast between sql and mysql?