SELECT INTO and “Undeclared variable” error

前端 未结 10 2218
你的背包
你的背包 2020-11-30 06:58

When I try to execute following query:

SELECT id_subscriber
  INTO newsletter_to_send
  FROM subscribers 

I get an error:

10条回答
  •  爱一瞬间的悲伤
    2020-11-30 07:39

    MySQL does not support SELECT INTO [table]. It only supports SELECT INTO [variable] and can only do this one variable at a time.

    What you can do, however is use the CREATE TABLE syntax with a SELECT like so:

提交回复
热议问题