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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to execute stored procedure and set temp table in sql server?

1040


can we have a nested transaction? : Sql server database administration

1096


What are the database objects? : SQL Server Architecture

1052


Is it true that rules do not apply to data already existing in a database at the time the rule is created?

1042


Define primary key?

1140


What is Fragmentation and Defragmentation? For 32GB Table,How can we do the fragmentation?

4386


What are the key configuration files for sql server reporting services ?

167


Are connections to sql server encrypted?

1004


How can you hide the sql server instances?

1021


What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?

1198


Does windows server 2016 come with sql server?

938


Explain indexes disadvantages?

1086


How to delete duplicate rows in sql server?

1109


List some advantages and disadvantages of stored procedure?

1016


is there a column to which a default can't be bound? : Sql server database administration

1015