CASE WHEN TM2.Y IS NULL THEN NVL(TM2.Y,10000)> TM1.值 ELSE TM2.Y > TM1.值 END
(CASE WHEN TM2.Y IS NULL THEN '10000' ELSE TM2.Y END)> TM1.值