-
统计数量(去重)
SELECT COUNT(DISTINCT common_name) FROM drug; -
load file
> load data local infile 'file_path' into table test_table
> FIELDS TERMINATED BY '\t<FIELDS TERMINATED>\t'
> ENCLOSED BY ” ESCAPED BY ”
> LINES TERMINATED BY '\n<LINES TERMINATED>\n'
> (field1,field2,field3,field4,field5,field6);
若数据中有反斜杠,需要指定 ESCAPED BY ”
- mysql对json的支持
- SELECT json_extract(obj, '$.name') FROM
table_name
WHEREfield1
=0 and json_extract(json_field
, '$.name') is not null; - update
table_name
setjson_field
= json_set(json_field
, '$.country', '德国', '$.name', '乳糖') whereid
= 12505031;
网友评论