假设我们要获取结果集的前 1 条记录。有没有更优雅的方法来做到这一点?
WITH temp
AS ( SELECT WKFC_CRONOLOGIA_ID
FROM SIUWKF.WKF_CRONOLOGIA c
WHERE Ogg_oggetto_id = vOGG_ID
AND TOG_TIPO_OGGETTO_ID = vTOG
AND C.WKFC_DATA_FIN = TO_DATE ('31/12/9999', 'DD/MM/YYYY')
AND Wkfc_Tipo = 'STATO'
ORDER BY WKFC_DATA_INI DESC)
SELECT WKFC_CRONOLOGIA_ID
INTO vCRONOLOGIA_ID
FROM temp
WHERE ROWNUM = 1;