multiple values in mysql variable

后端 未结 6 2024
渐次进展
渐次进展 2021-02-05 13:49

The following works as expected when there is a single value stored in a variable.

SET @a := \"20100630\";
SELECT * FROM wordbase WHERE verified = @a;
         


        
6条回答
  •  失恋的感觉
    2021-02-05 14:02

    SELECT GROUP_CONCAT(field_table1 SEPARATOR ',') FROM table1 into @var;
    

    then

    SELECT * FROM table2 WHERE field_table2 in(@var);
    

    works fine for me

提交回复
热议问题