Best Workaround with LIMIT subquery MySQL
- by Hiyasat
Hi all,
i want to create Stored PROCEDURE with multi statement, and it not working , and Google the problem and found that mysql dose not support Subquery statement "MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'"
My statement like this:
DROP PROCEDURE IF EXISTS proc_Name;
CREATE PROCEDURE `DBName`.`proc_Name`()
BEGIN
SELECT FROM table1 WHERE ORDER BY table1_Colom LIMIT 100;
UPDATE table2 SET table2_colom1 = 1 WHERE ID IN (SELECT ID FROM table2 ORDER BY table2_colom1 LIMIT 100);
END ;
Thanks in Advanced