Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // OLD
- select `prods`.*, `cat_prod`.`cat_id` as `pivot_cat_id`, `cat_prod`.`prod_id` as `pivot_prod_id` from `prods` inner join `cat_prod` on `prods`.`id` = `cat_prod`.`prod_id` where `cat_prod`.`cat_id` = 55 and `enabled` = 1 order by `onmarket` desc, `priority` desc limit 25 offset 49975;
- // NEW
- select `prods`.*, `cat_prod`.`cat_id` as `pivot_cat_id`, `cat_prod`.`prod_id` as `pivot_prod_id` from (select * from `prods` where `enabled` = 1 order by `onmarket` desc, `priority` desc) prods inner join `cat_prod` on `prods`.`id` = `cat_prod`.`prod_id` where `cat_prod`.`cat_id` = 55 limit 25 offset 49975
Add Comment
Please, Sign In to add comment