当前位置:网站首页>MySQL add field or create table SQL statement

MySQL add field or create table SQL statement

2022-06-09 05:28:00 Always happy old pea

Preface

Recently, we will send a message to the test and operation and maintenance department SQL Script , Used to using tools , Forget the original operation


SQL Script

1. Add fields to existing tables

ALTER TABLE  Table name  ADD  Field name   Field type ( Field length - optional ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci   NOT NULL( Can't be empty ) DEFAULT 0( The default value is ) COMMENT ' remarks '( remarks )AFTER  After specifying the field ( No default last );

Now there is no such field in the table :
 Insert picture description here

	ALTER TABLE cl_member_wallet_withdrawal_log ADD COLUMN state char(1) DEFAULT '0' COMMENT &#
原网站

版权声明
本文为[Always happy old pea]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206090519252771.html