Re: "SELECT IN SELECT" problem in MySQL
> the result of sql statment "SELECT rsa_lookup_id FROM `rsa_policy_plan_lookup` WHERE rsa_plan_id=1" is "11,12,16"
Then there's something wrong with the database design, the something being a violation of the atomicty rule: columns should not contain lists of values.
IN(list) expects a literal list. To use a dynamic value for the list, concatenate and prepare eg ...
@list = '1,2,3';
@sql = concat( 'select x from a where x in(', @list, ')' );
prepare stmt from @sql;
execute stmt;
drop prepare stmt;
Subject
Written By
Posted
September 19, 2014 08:36AM
Re: "SELECT IN SELECT" problem in MySQL
September 19, 2014 02:55PM
September 21, 2014 08:52PM
September 22, 2014 09:48AM
September 23, 2014 05:07AM
September 21, 2014 09:24PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.