我需要返回operacao='DELETE'
如果它存在,或者如果它不存在,则返回它现在返回的相同内容。现在查询返回找到的第一个'operacao'。
让我们说我需要知道operacao也存在'DELETE'。
SELECT A.*, wf.RHID as rhidwf, wf.operacao as operacao
from (
SELECT
CONCAT(RHID) AS pk, RHID, CD_DOC_ID, SEQ, NR_DOCUMENTO, EMISSOR,
DT_EMISSAO, DT_VALIDADE
FROM rh_id_documentos
WHERE RHID='6' AND CD_DOC_ID='1' AND SEQ='1') A
LEFT JOIN fo_on_workflow wf ON A.pk = wf.RHID
GROUP BY A.RHID, A.CD_DOC_ID, A.SEQ;
答案 0 :(得分:1)
(define high
(λ (start stop)
(cond
[(> start stop) '()]
[else (cons start (high (add1 start) stop))])))