将json 转换成表使用
select * from json_table('["javacoder", 321, "xyz"]', "$[*]" columns (c1 varchar(26) path '$[0]') ) as t;
mysql 查询层级结构
1 2 3 4 5 6 7 8 |
with recursive cte(id, name, parent_id) as ( select * from ebot.test where id = 1 union all select t.id, t.name, t.parent_id from ebot.test t inner join cte on cte.id = t.parent_id ) select * from cte; |
select find_in_set('123', "xyz,123,javacoder.cn")
#判断在字符串中是否存在指定的子串, 注意空格
Posted in: MySQL practise
Comments are closed.