Created
April 29, 2020 02:24
-
-
Save workze/26b79108c6299b59c238578aa96350d2 to your computer and use it in GitHub Desktop.
mysql generate column 生成列
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table `tt` ( | |
`id` int(11) not null, | |
`first_name` varchar(20), | |
`last_name` varchar(20), | |
`full_name` varchar(40) as ( concat(first_name, ' ', last_name) ) | |
primary key (`id`) | |
) engine=InnoDb DEFAULT charset=utf8mb4; | |
插入:1、不带full_name;2、只能带 DEFAULT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment