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 |
What is 3nf normalization form?
What is normalization? Explain its different types?
What is difference between process and thread? Explain lazy writer funcationality.
What is bit data type? What's the information that can be stored inside a bit column?
What happens when unicode strings concatenate with non-unicode strings?
What is raiseerror? What is raiseerror?
How do I install only the client tools of sql server 2000?
What are the difficulties faced in cube development? : sql server analysis services, ssas
How to call a function from a stored procedure in SQL Server ?
1.What is the deferece between DBMS & RDBMS? 2.How can you trouble shoot? If u will get error while installing sql server? 3.How can u trouble shoot slow running query? 4.how can u trouble log shipping errors? 5.why do we use merge replication instead of T.log replication?
What is the difference between a unique key and primary key?
What is postgresql server?
Oracle (3253)
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)