SQL发出来
——————————
SELECT
A.A,
TO_CHAR (SYSDATE, 'YYYY') - TO_CHAR (A.A, 'YYYY') 值,
AA.Z
FROM
A
LEFT JOIN AA AS B ON B.X <= TO_CHAR (SYSDATE, 'YYYY') - TO_CHAR (A.A, 'YYYY')
AND CASE
WHEN B.Y IS NULL THEN
'1=1'
ELSE
B.Y > TO_CHAR (SYSDATE, 'YYYY') - TO_CHAR (A.A, 'YYYY')
END