Muchas gracias por sus respuestas, les comento como me fue:
Probe con esto:
Código SQL:
Ver originalSET @campo = 'municipio';
SET @orden = 'ASC';
SET @s = CONCAT('SELECT * FROM municipio ORDER BY ',@campo,' ',@orden);
PREPARE stmt2 FROM @s;
EXECUTE stmt2;
DEALLOCATE PREPARE stmt2;
y me arroja el siguiente error
>[Error] Líneas de script: 4-9 ----------------------
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET @orden = 'ASC';
SET @s = CONCAT('SELECT * FROM municipio ORDER BY ',@campo,'' at line 2
y estas advertencias
Advertencias: --->
W (1): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET @orden = 'ASC';
SET @s = CONCAT('SELECT * FROM municipio ORDER BY ',@campo,'' at line 2