Vous pouvez utiliser des déclarations préparées
SET @a = (select tbl_names from tbl1);
SET @x := CONCAT('SELECT * FROM ', @a);
Prepare stmt FROM @x;
Execute stmt;
DEALLOCATE PREPARE stmt;
PREPARE Syntaxe
Bravo.
Vous pouvez utiliser des déclarations préparées
SET @a = (select tbl_names from tbl1);
SET @x := CONCAT('SELECT * FROM ', @a);
Prepare stmt FROM @x;
Execute stmt;
DEALLOCATE PREPARE stmt;
PREPARE Syntaxe
Bravo.