在PREPARE语句期间,MySQL错误操作数应包含1列

时间:2014-02-13 21:46:15

标签: mysql sql mysql-workbench

DROP VIEW IF EXISTS v1; 

SET @stmt_text = CONCAT('CREATE VIEW v1 AS SELECT (ID, PMID, Name, Address) FROM MyData
    LEFT JOIN My_Parameters USING (ID)
    WHERE MyData.ID > (newid) AND PMID > (PM_1)

PREPARE stmt FROM @stmt_text; 

EXECUTE stmt; 

注意:v1有100行和4列数据,实际选择有很多'连接'

DROP和SET语句执行时没有错误,但

PREPARE stmt FROM @stmt_text
Error Code: 1241. Operand should contain 1 column(s)    

我该如何解决这个问题?

0 个答案:

没有答案