|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
insert select
From: Hiep Nguyen (hiep
ee.ucr.edu)
Date: Thu Apr 03 2008 - 09:23:27 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
hi all, i have a question on insert ... select statement.
tbl_1(fld1,fld2,fld3, ....)
fld1 int primary key auto_increment not null
tbl_2(fld_a,fld_b,fld_c,...)
how do i construct my select statement so that fld1 is auto increment?
insert into tbl_1(fld1,fld2,fld3) select xxx, fld_b, NOW() from tbl_2
where fld_a = '5';
what should 'xxx' be???
my goal is to get
fld1 = auto increment
fld2 = fld_b
fld3 = NOW()
i saw someone used '1', other used null for xxx. i'm confused.
thanks.
t. hiep
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]