If it is used together to INSERT a new entry, you can use something like this.
(You indicated in your comments that the identifier automatically increases, and another table needs the following identifier + 1)
INSERT INTO TABLE2 (id, field1, field2, field3, etc) VALUES( SELECT (MAX(id) + 1), field1, field2, field3, etc FROM TABLE1 WHERE condition_here_if_needed )
This is pseudo code, but you get the idea
Phill Pafford Sep 10 '09 at 14:23 2009-09-10 14:23
source share