Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how to copy only distinct data into another table which is not already exist in database?

Answers were Sorted based on User's Feedback



how to copy only distinct data into another table which is not already exist in database?..

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

how to copy only distinct data into another table which is not already exist in database?..

Answer / sheshu4040

SELECT DISTINCT * INTO TABLE_NEW FROM TABLE_EXISTING

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More SQL Server Interview Questions

Is it possible in sql table to have more than one foreign key?

0 Answers  


How to Install SQL SERVER 2005 remotely?

1 Answers   IBM,


How to get the definition of a stored procedure back?

0 Answers  


how to insert the values in 5 table at a time Using any single statement ?

6 Answers   Infosys, Value Labs,


WHY CAN WE CREATE ONLY ONE CLUSTERED INDEX ON A TABLE IN SQL SERVER?

8 Answers  


What are Magic Table?

34 Answers   3i Infotech, Digiweb, Evalueserve, NIIT, PL,


what is the main difference between after trigger and instead trigger.

2 Answers  


What do you mean by data integrity?

0 Answers  


Difference between rowid and rownum in SQL?

1 Answers   Virtusa,


Which tcp/ip port does sql server run on? How can it be changed?

0 Answers  


What are the results of running this script?

0 Answers  


When would you use sql joins?

0 Answers  


Categories