1,SELECT a.nid FROM `term_node` as a left join term_node as b on a.nid = b.nid where a.tid = 5 and b.tid = 6
2,RewriteRule ^node/(.*).html$ index.php?q=node/$1 [L,QSA]