SELECT `t` . `term_id` , `tt` . `term_taxonomy_id` FROM `wp3_terms` `t` INNER JOIN `wp3_term_taxonomy` `tt` ON ( `tt` . `term_id` = `t` . `term_id` ) WHERE `t` . `slug` = ? AND `tt` . `parent` = ? AND `tt` . `taxonomy` = ? AND `t` . `term_id` < ? AND `tt` . `term_taxonomy_id` != ? 