0
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; 

Note: v1 has 100 rows and 4 columns of data and the actual select has many 'joins'

DROP and SET statements execute without error but,

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

How can I resolve this?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199

0 Answers0