我有这个 SQL 脚本:
SELECT distinct
A.APNO, B.APUSEINSPKEY, Count(*)
FROM
CDR_USE.useappl A, CDR_USE.USEINSP B,
CDR_USE.useappldetail C, FIREUSEPERMITS.buildinginfo D,
FIREUSEPERMITS.blginfogrd E
WHERE
A.APUSEKEY = B.APUSEKEY
AND a.apusekey = b.apusekey
AND A.apusekey = C.APUSEKEY
AND c.apuseappldtlkey = d.apuseappldtlkey
AND d.buildinginfokey = E.BUILDINGINFOKEY
AND E.EXPIREDATE IS NULL
GROUP BY
A.APNO, B.APUSEINSPKEY
HAVING
COUNT(*) > 1
返回此结果:
*APNO APUSEINSPKEY COUNT
*FPBTEN12245 28922 2
*FPBBLD17053 52096 2
*FPBTEN22105 74489 2
*FPBTEN22126 74552 2
*FPBTEN25730 91536 2
我需要什么代码来获取每个记录的列表APNO
?例如,我知道 中有 2 条记录FPBTEN12245
,但我如何获取列出的这 2 条记录的信息列表以及其余记录的信息?
FPBBLD33567 125826 2