获取数据库json中某个字符串的值并去掉双引号
SELECT
t4.items_name,
t4.attribution,
t5.nick_name,
t5.user_name,
t6.`name`,
(
REPLACE ( JSON_EXTRACT( t3.classif_number, CONCAT( '$[', JSON_LENGTH( t3.classif_number ) - 1, ']' )), '"', '' )) #获取数据库json中的某个字符串并去掉双引号
FROM
ec_inspection_report t1
LEFT JOIN ec_inspection_report_item t2 ON t1.number = t2.report_number
LEFT JOIN ec_inspection_item t3 ON t2.item_number = t3.number
LEFT JOIN ec_inspection_items t4 ON t3.items_number = t4.number
LEFT JOIN sys_user t5 ON t1.user_id = t5.user_id
LEFT JOIN basics_catalogue t6 ON t6.`code` =(
REPLACE ( JSON_EXTRACT( t3.classif_number, CONCAT( '$[', JSON_LENGTH( t3.classif_number ) - 1, ']' )), '"', '' ))