Assuming you have a recent MySQL version (changed somehwere in 5.1.XX iirc) and also insert your data with one query, that is[coee]
VALUES (...),(...)[/code]
rather than separate queries
INSERT INTO ... VALUES(...);
INSERT INTO ... VALUES(...);
mysqli::insert_id holds the FIRST autogenerated value for the last statement. If you're not using PHP, select last_insert_id() MAY do the same thing. All I remember is that there are, or used to be, differences between those two. Refer the reference manual to find out for sure.
Then select anything where id > ...