Reputation: 83
In Mysql/MariaDB I like to set the comment of an existing column to a string containing the current date.
But I only get SQL syntax errors. I've tried so far:
SELECT @date := CONCAT('saved at', now());
ALTER TABLE table_name MODIFY
column_name <complete column definition> COMMENT @date;
Also not working:
ALTER TABLE table_name MODIFY
column_name <complete column definition> COMMENT now();
Of course this works:
ALTER TABLE table_name MODIFY
column_name <complete column definition> COMMENT 'saved at today';
Is this possible without an external script?
Upvotes: 0
Views: 309