Add mariadb examples

This commit is contained in:
Super User
2024-05-16 13:05:18 +03:00
parent 83da02ddfd
commit f5c38d9caa

View File

@@ -16,5 +16,9 @@ done
## Append field in table
```sql
ALTER TABLE existsTableName ADD COLUMN `newFieldName` varchar(64) NOT NULL DEFAULT '';
CREATE TABLE tableName_new AS (SELECT * FROM tableName);
ALTER TABLE tableName_new ADD COLUMN `newFieldName` varchar(64) NOT NULL DEFAULT '' AFTER `existFieldName`;
RENAME TABLE tableName TO tableName_old; RENAME TABLE tableName_new TO tableName;
```