Mysql insert into 2 tables

Posted by Spidfire on Stack Overflow See other posts from Stack Overflow or by Spidfire
Published on 2010-06-16T13:23:28Z Indexed on 2010/06/16 18:52 UTC
Read the original article Hit count: 153

Filed under:
|
|

I want to make a insert into 2 tables

visits:

visit_id int | card_id int

registration:

registration_id int | type enum('in','out') | timestamp int | visit_id  int

i want something like:

INSERT INTO `visits` as v ,`registration` as v
(v.`visit_id`,v.`card_id`,r.`registration_id`, r.`type`, r.`timestamp`, r.`visit_id`) 
VALUES (NULL, 12131141,NULL, UNIX_TIMESTAMP(), v.`visit_id`);

I wonder if its possible

© Stack Overflow or respective owner

Related posts about mysql

Related posts about insert