Syntax\n------\n\nSELECT col_name [, col_name] ...\n    INTO var_name [, var_name] ...\n    table_expr\n\nDescription\n-----------\n\nSELECT ... INTO enables selected columns to be stored directly into variables. No resultset is produced. The query should return a single row. If the query returns no rows, a warning with error code 1329 occurs (No data), and the variable values remain unchanged. If the query returns multiple rows, error 1172 occurs (Result consisted of more than one row). If it is possible that the statement may retrieve multiple rows, you can useLIMIT 1 to limit the result set to a single row.\n\nThe INTO clause can also be specified at the end of the statement.\n\nIn the context of such statements that occur as part of events executed by the Event Scheduler, diagnostics messages (not only errors, but also warnings) are written to the error log, and, on\\\nWindows, to the application event log.\n\nThis statement can be used with both local variables and user-defined variables.\n\nFor the complete syntax, see SELECT.\n\nAnother way to set a variable's value is the SET statement.\n\nSELECT ... INTO results are not stored in the query cache even if SQL_CACHE is specified.\n\nExamples\n--------\n\nSELECT id, data INTO @x,@y \nFROM test.t1 LIMIT 1;\nSELECT * FROM t1 WHERE t1.a=@x AND t1.b=@y\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/programmatic-compound-statements/selectinto