mysql 函数

一、字段值是按照逗号分割保存

SELECT GROUP_CONCAT(option_name) busiTypeName,GROUP_CONCAT(option_code) option_code FROM sys_option_conf WHERE option_code REGEXP (
SELECT REPLACE (( SELECT busi_type FROM cont_base_info WHERE id = '878228366862319616'), ',','|'))

二、将查询出来的值进行逗号分割保存

 GROUP_CONCAT(option_name) busiTypeName

三、相关信息

select a.* ,b.* from (SELECT
cbi.*,soc.option_name as contStatusName,soc1.option_name as contTypeName
FROM cont_base_info cbi
left join sys_option_conf soc on cbi.cont_status = soc.option_code
left join sys_option_conf soc1 on cbi.cont_type = soc1.option_code
WHERE cbi.data_status = 100101 and cbi.id = '878228366862319616' ) a ,
(SELECT GROUP_CONCAT(option_name) busiTypeName,GROUP_CONCAT(option_code) option_code FROM sys_option_conf WHERE option_code REGEXP (
SELECT REPLACE (( SELECT busi_type FROM cont_base_info WHERE id = '878228366862319616'), ',','|'))) b
where a.busi_type = b.option_code

上一篇:一款基于Uniapp开发的开源低代码平台


下一篇:Echarts中Option属性设置