

























mysql的json类型
create table if not exists products (id int auto_increment primary key, details json);
json类型字段可以指定为not null,但不能指定默认值。事实上,一共有4种类型不能指定默认值,分别是blob、text、geometry、json。
初始化数据:
insert into products (details) values ('{"tags":["tag1","tag2","tag3"]}'),('{"tags":["tag1","tag4","tag5"]}');
插入json数据和插入varchar数据一样,都要用单引号包住。
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。