我想给WM_CONCAT(Z.ORIGIN) as 用地指标来源一个查询条件
写法应该是怎么样的各位大佬这是我的sql
SELECT
T.IID,
T.PROJ_NAME,
WM_CONCAT(Z.ORIGIN) as 用地指标来源
FROM
UT_SP_PROJ_BUILD T,
OT_BATCHAPPLY O,
UT_SP_ZBLY Z
WHERE
T.PROJ_NAME = O.NAME(+)
AND O.ID = Z.BATCH_ID(+)
GROUP
BY T.IID,
T.PROJ_NAME
下面是答案:
SELECT
T.IID,
T.PROJ_NAME,
WM_CONCAT(Z.ORIGIN) as 用地指标来源
FROM
UT_SP_PROJ_BUILD T,
OT_BATCHAPPLY O,
UT_SP_ZBLY Z
WHERE
T.PROJ_NAME = O.NAME(+)
AND O.ID = Z.BATCH_ID(+)
GROUP BY
T.IID,
T.PROJ_NAME
HAVING
WM_CONCAT(Z.ORIGIN) like '%天府新区%';