SELECT .. INTO returns more than one rows - Mysql

前端 未结 1 1305
北荒
北荒 2021-01-27 10:57

i have a basic stored procedure

DECLARE user_o VARCHAR(50);

SELECT user_name INTO user_o FROM users WHERE topic_id = 54 AND entry_time BETWEEN 
2017-09-17 AND d         


        
相关标签:
1条回答
  • 2021-01-27 11:23

    Its because you are inserting the result 'INTO' a variable and because the result is more than a single value, hence the error.

    You have a limit of 10, try changing to 1, that will fix it, if you want multiple values returned then you need to manage these in a recordset.

    0 讨论(0)
提交回复
热议问题