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 |
Can you change the data type of a column in a table after the table has been created? If so, which command would you use?
Explain temporary table vs table variable by using cursor alternative?
what is the difference between group and having give an example with query and sample output
can you any body tell me why are go for the rebuild the master database.what is the reason?
what is node in sql server?
2 Answers CarrizalSoft Technologies, Google, NIIT, Nittany, TATA,
wat is mean by trigger?.......normally wat use......when trigger used in sql........... plz cleary say with example.......
I have cleared sbi clerk examination. I am Bachelor in computer application (BCA) graduate. so which type of question related bca in sbi clerk interviews. pls answers me at sejalvaghela@yahoo.co.in.. and also tell me which type of question asked in sbi clerk interview.
Write query to return all rows sql?
Observed that some SP’s / Jobs are processing late, how to troubleshoot to improve performance?
1)what is the difference between Reinitializing a Subscription and synchronization the subscription? 2)when to use reinitializing ? 3)when to use synchronization? 4)when adding table or deleting a table what to do?(reinz.. or syn) 5)when adding a column what to do?
I have to display ten columns values from diffrent ten tables. how many joins are require?
10 Answers CarrizalSoft Technologies, HCL,
What is amo? : sql server analysis services, ssas
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)