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 |
How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?
What authentication modes does sql server support?
Questions on identity?
What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?
Explain the various types of concurrency problem?
What are the underflow and overflow behaviors on float literals?
What types of replication are supported in sql server?
How to Execute an Operating System Command From Within SQL Server ?
What does nvl stand for?
explain databases and sql server databases architecture? : Sql server database administration
How do I start and stop sql server?
What is difference between standardization and normalization?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)