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 |
When we should use @@error?
Explain about SQLOS?
What is scd (slowly changing dimension)? : sql server analysis services, ssas
If I delete a template from the list in sql studio, will it be deleted from the hard disk? : sql server management studio
What do you understand by recursive stored procedure?
How display code or Text of Stored Procedure using Sql query in Sql Server ?
What is a unique key constraint?
Can I run multiple instances of sql server 2000 at the same time on one computer?
What is scrollable cursor?
Why foreign key column allowing null values even a parent tables reference key column not having null value..
explain the difference between oracle- sql and sql server sql ? if both are same y we r using 2 sw.s?
how will u create "n" possible tables in sql...