| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Paul DuBois | Date: | July 19 1999 9:04pm |
| Subject: | Re: Using SQL to create new table based on select results | ||
| View as plain text | |||
At 3:27 PM -0500 7/19/99, Webber, William D. wrote: >Greetings all. I was wondering if there is a way via an SQL statement to >create a new table and fill it with data from a select statement. >In Psuedocode: >select * from MyTable where FirstName like "%A" >create table MyNewTable( First varchar(20), LastName (20)) >Insert into MyNewTable ( MyNewdata) > >I know the basics of select statements, but do not know how to shoot the >resulting data into a new table. Can you do that? There sure is, it's a new thing in MySQL 3.23. The syntax is: CREATE TABLE new_tbl_name SELECT [rest of normal select statement here] You don't even have to know the types of the columns your selecting this way. -- Paul DuBois, paul@stripped
| Thread | ||
|---|---|---|
| • Using SQL to create new table based on select results | William D. Webber | 20 Jul |
| • Re: Using SQL to create new table based on select results | Benjamin Pflugmann | 20 Jul |
| • Re: Using SQL to create new table based on select results | Paul DuBois | 20 Jul |
| • Re: Using SQL to create new table based on select results | Sasha Pachev | 20 Jul |
| • Re: Using SQL to create new table based on select results | Johan Isacsson | 20 Jul |
| • Re: Using SQL to create new table based on select results | Paul DuBois | 20 Jul |
| • Re: Using SQL to create new table based on select results | Johan Isacsson | 20 Jul |
| • Re: Using SQL to create new table based on select results | Sasha Pachev | 20 Jul |
| • Re: Using SQL to create new table based on select results | sinisa | 20 Jul |
| • Re: Using SQL to create new table based on select results | Kevin Smith | 20 Jul |
| • Re: Using SQL to create new table based on select results | sinisa | 20 Jul |
| • Re: Using SQL to create new table based on select results | Michael Widenius | 2 Aug |
