Best Workaround with LIMIT subquery MySQL
Posted
by
Hiyasat
on Stack Overflow
See other posts from Stack Overflow
or by Hiyasat
Published on 2011-01-09T07:41:40Z
Indexed on
2011/01/09
7:54 UTC
Read the original article
Hit count: 311
mysql
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
© Stack Overflow or respective owner