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...

Creating Tables Using SELECT

Answer Posted / mohammadali.info

*SELECT...INTO essentially combines CREATE TABLE and SELECT in a single statement. The AS clause can be used to change the column labels and thus control the column names in the new table. The other commands in the figure show the new table's structure and contents.

-SELECT firstname, lastname, city, state
INTO newfriend
FROM friend;

-SELECT...INTO tablename can also be written as CREATE TABLE tablename AS SELECT.... The preceding query can then be rewritten as
CREATE TABLE newfriend AS SELECT firstname, lastname, city, state FROM friend.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the dis_advantages of stored procedures, triggers, indexes?

2211


How would you go about developing a ssrs report?

166


Why do we use functions?

902


Can sql servers linked to other servers?

1028


What is application role in sql server database security? : sql server security

1051


What are the instances when triggers are appropriate?

976


How to divide query output into multiple groups with the group by clause in ms sql server?

1023


What is read committed?

1073


How to include text values in sql statements?

1025


What is the use of commit?

992


What is the use of tempdb? What values does it hold?

1058


Explain full-text indexing?

970


How many categories of functions based their return modes?

1095


What is tempdb in sql server?

961


Differentiate between a local and a global temporary table?

946