I\'m trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this?
EDIT: There are 53 columns i
Actually there is a way, you need to have permissions of course for doing this ...
SET @sql = CONCAT('SELECT ', (SELECT REPLACE(GROUP_CONCAT(COLUMN_NAME), ',', '') FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '' AND TABLE_SCHEMA = ''), ' FROM ');
PREPARE stmt1 FROM @sql;
EXECUTE stmt1;
Replacing , and
- 热议问题