SELECT `B` . `id` AS `bug_id` , `BT` . `tag_id` , `BT` . `user_id` , `BT` . `date_attached` FROM `mantis_bug_table` `B` LEFT OUTER JOIN `mantis_bug_tag_table` `BT` ON `B` . `id` = `BT` . `bug_id` WHERE `B` . `id` IN (...) 