Not quite clear what is the problem. To search in several tables you can use LEFT JOIN, I suppose, and to limit IDs - just write in LEFT JOINs conditions "table_name.ID<=20". If you just need a tip - it will help, I hope, if more information - let us know :-)