sql2 = select * from g5_write_test where wr_parent = '7' and wr_is_comment = 1 order by wr_comment, wr_comment_reply sql5 = SELECT * FROM g5_write_test WHERE wr_num in (SELECT wr_num FROM g5_write_test WHERE mb_id<>'' and mb_id='') and wr_is_comment = 0 order by wr_num, wr_reply limit 0, 5