SELECT play_copy FROM vts2_lesson_hour where play_copy is not null
SELECT * from vts2_lesson_hour vlc where JSON_EXTRACT(vlc.play_copy, '$[1]')
SELECT JSON_EXTRACT('[10, 20, [30, 40]]', '$[0]')
#生成json数组
SELECT JSON_ARRAY(1, "json数组", NULL, TRUE, CURTIME());
#生成json对象
SELECT JSON_OBJECT('id', 87, 'jsonObject', '单个json对象');
#字符串用双引号括起来
SELECT JSON_QUOTE('null'),JSON_QUOTE('"null"'),JSON_QUOTE('1');
SELECT JSON_QUOTE('null'), JSON_QUOTE('"null"'),JSON_QUOTE(1);
#String转json对象
select CONVERT(expr USING transcoding_name)('{"mail": "amy@gmail.com", "name": "Amy"}',JSON);
SELECT JSON_TYPE('{}');
SELECT JSON_
SET @j = '{"a": 1, "b": 2, "c": {"d": 4}}';
SET @j2 = '1';
SELECT JSON_CONTAINS(@j, @j2, '$.b');
SELECT JSON_EXTRACT(vlh.play_copy, '$[1]') FROM vts2_lesson_hour vlh WHERE vlh.play_copy is not null
网友评论