SELECT `b` . * , `t` . `note` FROM `mantis_bugnote_table` `b` LEFT JOIN `mantis_bugnote_text_table` `t` ON `b` . `bugnote_text_id` = `t` . `id` WHERE `b` . `bug_id` = ? ORDER BY `b` . `date_submitted` ASC , `b` . `id` ASC 