Notice: Error: Incorrect usage of UNION and LIMIT
Error No: 1221
SELECT COUNT(product_id) AS total FROM (SELECT similar_id AS product_id FROM tm_product_similar ps LEFT JOIN tm_product p ON (ps.similar_id = p.product_id) LEFT JOIN tm_product_to_store p2s ON (p.product_id = p2s.product_id) WHERE ps.product_id = '10309' AND p.status = '1' AND p.date_available <= '2017-05-27' AND p2s.store_id = '0' LIMIT 12 UNION SELECT p.product_id AS product_id FROM tm_product p LEFT JOIN tm_product_to_category p2c ON (p.product_id = p2c.product_id) LEFT JOIN tm_product_to_store p2s ON (p.product_id = p2s.product_id) WHERE p2c.category_id IN (25,44,48,60,65,70) AND p.product_id <> '10309' AND p.status = '1' AND p.date_available <= '2017-05-27' AND p2s.store_id = '0' LIMIT 12) AS tbl in /home/sites/tandmwholesale.com/public_html/system/database/mysql.php on line 49