mysql存储过程多参数

plupiseo  于 2021-06-17  发布在  Mysql
关注(0)|答案(0)|浏览(219)

我正在尝试在select语句(存储过程)中添加多个动态列,但在我的末尾它不起作用,您能帮我做同样的事情吗。

BEGIN SET @col1 = col1;SET @col1 = col2;SET @getID = CONCAT('SELECT ' ,@col1 = col1, @col2 = col2,' FROM',tablename_In,' WHERE `type`= type ORDER BY id DESC LIMIT ?,?'); PREPARE stmt FROM @getID;SET @START =_START; SET @LIMIT = _LIMIT;EXECUTE stmt USING @START, @LIMIT; DEALLOCATE PREPARE stmt; END

另外,我还有另一个存储过程,它在查询之间也不起作用:

BEGIN SET @getID = CONCAT('SELECT count(id) as co FROM ',tablename_In,' WHERE',est_time,' BETWEEN',start_date,'AND',end_date);PREPARE stmt FROM @getID;  EXECUTE stmt; DEALLOCATE PREPARE stmt; END

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题