SELECT table1.`id`,table1.`depart`, table1.`title`, table1.`desc`, table1.`writer`, table1.`view`, table1.`date`, table1.`keywords`, table1.`seo_desc`,table1.`images`
,table1.`code`,table1.`price_before_out`,table1.`price_after_out`,table1.`shipping_out`,table1.`video`,table1.`colors`,table1.`dimintions`,table1.`trademark`,table1.`material`,table1.`active` , table2.title as depart_title
FROM
products as table1 join departs_products as table2 join departs_products
where
table1.depart=table2.id and table1.active=1 and table1.id=98 and departs_products.id=table1.depart
order by
table1.id desc , table1.priority desc