Sie können vorbereitete Anweisungen verwenden
SET @a = (select tbl_names from tbl1);
SET @x := CONCAT('SELECT * FROM ', @a);
Prepare stmt FROM @x;
Execute stmt;
DEALLOCATE PREPARE stmt;
PREPARE-Syntax
Prost.
Sie können vorbereitete Anweisungen verwenden
SET @a = (select tbl_names from tbl1);
SET @x := CONCAT('SELECT * FROM ', @a);
Prepare stmt FROM @x;
Execute stmt;
DEALLOCATE PREPARE stmt;
PREPARE-Syntax
Prost.