Only MySQL 8+ / MariaDB 10.5+ supports the "RENAME COLUMN" syntax. (which is better as the field type does not need respecifying)
Altering table column types also varies based on DB.
I think most DBs don't support altering column types and renaming at the same time like MySQL does - meaning we'll need to split the operations in our code.
I do not know what the ANSI standards are, if there are any for this kind of query.
I did have a look at the ANSI standard. They do not seem to specify renaming columns, but do specify adding and dropping columns and changing types.
The ANSI standard is *horrible* to read, it's all defining a formal grammar and doesn't even show any examples of real SQL. Rant: What's the point of going to the extreme effort to define a standard in formal grammar (and failing to make a spec that is actually readable), when you can't even get any vendor to implement the standard well? (none do)
Only MySQL 8+ / MariaDB 10.5+ supports the "RENAME COLUMN" syntax. (which is better as the field type does not need respecifying)
Altering table column types also varies based on DB.
I think most DBs don't support altering column types and renaming at the same time like MySQL does - meaning we'll need to split the operations in our code.
I do not know what the ANSI standards are, if there are any for this kind of query.
https://www.techonthenet.com/sql/tables/alter_table.php
The ANSI standard is *horrible* to read, it's all defining a formal grammar and doesn't even show any examples of real SQL. Rant: What's the point of going to the extreme effort to define a standard in formal grammar (and failing to make a spec that is actually readable), when you can't even get any vendor to implement the standard well? (none do)