Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Inserting multiple records


Message #1 by Desmond O'Toole <DO'Toole@I...> on Tue, 24 Sep 2002 16:10:12 +0100
insert into table1 (field1,field2,field3)
select x, y, z
from table2
where flag = 'y'

as for a book that can help, there are quite a few available.  I can't remember the
exact titles (it's been a while since i've look for pure SQL books), but anything
with titles like:

Programming SQL
Understanding SQL

possibly even the Teach Yourself SQL in 21 days book would be good for you.  If you
need a database specific sql book (t-sql (transact-sql) for sql server, for example)
then look for something that specifies that. Programming SQL Server.  Programmers
Guide to SQL 99 (the newest structured query language standard).

good luck.

john

--- Desmond O'Toole <DO'Toole@I...> wrote:
> I need to inset multiple records into a table from another table like this
> 
> insert table1 (field1,field2,field3)
> values(tbl2.x,tbl2.y,tbl2.z)
> from tbl2
> where
> tbl2.flag = 'Y'
> 
> can anyone help with the correct syntax. Also any good book that goes into
> SQL better.
> 



=====

---------------------------- 
John Pirkey 
MCSD 
http://www.stlvbug.org


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

  Return to Index