LIKE CONCAT 连用
Posted xiaowoniulx
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LIKE CONCAT 连用相关的知识,希望对你有一定的参考价值。
SELECT (@i :=@i + 1) AS number, x.uuid, x.payment_code, x.supplier_name, x.receive_money, x.is_export_flag, x.export_time, x.payer, x.region_name, x.user_name, x.marketer_id , x.region_id FROM ( SELECT DISTINCT a.uuid, a.payment_code, a.supplier_name, a.receive_money, IF ( is_export_flag = 0, ‘未导出‘, ‘已导出‘ ) AS is_export_flag, a.export_time, b.payer, d.region_name, GROUP_CONCAT(DISTINCT f.user_name) AS user_name, -- ( f.user_name )AS user_name, e.marketer_id, d.uuid as region_id FROM biz_lc_payment_info a, biz_lc_payment_invoice_info b LEFT JOIN biz_item_company c ON b.payer = c.item_company_name AND c.sys_status = 1 LEFT JOIN biz_item_region d ON c.region_id = d.uuid AND d.sys_status = 1 LEFT JOIN biz_link_marketer_region e ON e.region_id = d.uuid AND d.sys_status = 1 LEFT JOIN sys_user f ON e.marketer_id LIKE CONCAT(‘%‘, f.uuid, ‘%‘) AND f.sys_status = 1 WHERE a.payment_id = b.payment_id AND a.sys_status = 1 AND b.sys_status = 1 GROUP BY a.uuid ) x, (SELECT @i := 0) AS y WHERE -- x.marketer_id LIKE ‘%u1032%‘ x.is_export_flag = ‘已导出‘
以上是关于LIKE CONCAT 连用的主要内容,如果未能解决你的问题,请参考以下文章
Sequelize:WHERE LIKE 子句中的 Concat 字段