Re: JOIN BETWEEN 2 TABLES WITH DIFFERENT ID COUNTING
Posted by:
Rick James
Date: November 29, 2015 11:46AM
Bad design. Don't expect two AUTO_INCREMENTs to stay in sync.
If you want one id to match another, then don't make it AUTO_INCREMENT. Instead copy the value in. Such as
$id = SELECT id FROM table1 WHERE name = $name;
INSERT INTO table2 (id, ...) VALUES ($id, ...);
Subject
Written By
Posted
November 27, 2015 10:33AM
November 28, 2015 11:12AM
November 29, 2015 01:14PM
Re: JOIN BETWEEN 2 TABLES WITH DIFFERENT ID COUNTING
November 29, 2015 11:46AM
November 29, 2015 01:18PM
November 29, 2015 03:17PM
November 30, 2015 12:26PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.