如何在 MARIADB/MYSQL 中为函数/过程声明表变量?
不知道如何操作MySQL DECLARE THIS TABLE?
I don't know how to operate MySQL DECLARE THIS TABLE?
MS_SQL CAN
DECLARE @TEMP TABLE
(variable INT)
但是 MySQL
不能这样做!我该怎么做?
But MySQL
can't do this! How can i do it?
语法错误!!
推荐答案
如果您需要使表或数据库名称来自参数或变量,则需要
If you need to make a table or database name come from an argument or variable, you will need to
- 构造查询,可能使用
CONCAT
. PREPARE
查询.执行
查询.DEALLOCATE PREPARE
.
- Construct the query, probably using
CONCAT
. PREPARE
the query.EXECUTE
the query.DEALLOCATE PREPARE
.
相关文章