List:General Discussion« Previous MessageNext Message »
From:Sasha Pachev Date:July 19 1999 9:14pm
Subject:Re: Using SQL to create new table based on select results
View as plain text  
"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?
> Cheers, Will-
> 

You can do it in two steps:

create table foo ...
insert into foo select ...



-- 
Sasha Pachev
http://www.sashanet.com/ (home)
http://www.direct1.com/ (work)
Thread
Using SQL to create new table based on select resultsWilliam D. Webber20 Jul
  • Re: Using SQL to create new table based on select resultsBenjamin Pflugmann20 Jul
  • Re: Using SQL to create new table based on select resultsPaul DuBois20 Jul
  • Re: Using SQL to create new table based on select resultsSasha Pachev20 Jul
    • Re: Using SQL to create new table based on select resultsJohan Isacsson20 Jul
      • Re: Using SQL to create new table based on select resultsPaul DuBois20 Jul
        • Re: Using SQL to create new table based on select resultsJohan Isacsson20 Jul
    • Re: Using SQL to create new table based on select resultsSasha Pachev20 Jul
    • Re: Using SQL to create new table based on select resultssinisa20 Jul
Re: Using SQL to create new table based on select resultsKevin Smith20 Jul
Re: Using SQL to create new table based on select resultssinisa20 Jul
Re: Using SQL to create new table based on select resultsMichael Widenius2 Aug