简化sql: select JSON_UNQUOTE(JSON_EXTRACT(woo.attachment, '$.transformerObjList')) as transformerObjList from workflow_order woo where workflow_order_id in ( select c.workflow_order_id from ( select concat( JSON_UNQUOTE(JSON_EXTRACT(wo.attachment, '$.province')), JSON_UNQUOTE(JSON_EXTRACT(wo.attachment, '$.city')), JSON_UNQUOTE(JSON_EXTRACT(wo.attachment, '$.county')), JSON_UNQUOTE(JSON_EXTRACT(wo.attachment, '$.town')), JSON_UNQUOTE(JSON_EXTRACT(wo.attachment, '$.village')) ) as address , JSON_UNQUOTE(JSON_EXTRACT(wo.attachment, '$.dataType')) as dataType ,wo.workflow_order_id from workflow_order as wo ) as c where c.dataType = 1587434126787240000 and c.address = '江苏省无锡市宜兴市A镇8村'
时间: 2024-03-08 09:51:21 浏览: 130
python中urllib.unquote乱码的原因与解决方法
简化后的 SQL 查询语句如下:
```
SELECT JSON_UNQUOTE(JSON_EXTRACT(attachment, '$.transformerObjList')) AS transformerObjList
FROM workflow_order
WHERE workflow_order_id IN (
SELECT workflow_order_id
FROM (
SELECT CONCAT(
JSON_UNQUOTE(JSON_EXTRACT(attachment, '$.province')),
JSON_UNQUOTE(JSON_EXTRACT(attachment, '$.city')),
JSON_UNQUOTE(JSON_EXTRACT(attachment, '$.county')),
JSON_UNQUOTE(JSON_EXTRACT(attachment, '$.town')),
JSON_UNQUOTE(JSON_EXTRACT(attachment, '$.village'))
) AS address,
JSON_UNQUOTE(JSON_EXTRACT(attachment, '$.dataType')) AS dataType,
workflow_order_id
FROM workflow_order
) AS c
WHERE c.dataType = 1587434126787240000 AND c.address = '江苏省无锡市宜兴市A镇8村'
)
```
阅读全文