Pokud vaše verze Oracle podporuje LAG
pak je tu snadná možnost:
SELECT
id,
CASE WHEN value >= LAG(value, 1, value) OVER (PARTITION BY name ORDER BY meas_date)
THEN 0 ELSE 1 END AS flag
FROM yourTable
Pokud vaše verze Oracle podporuje LAG
pak je tu snadná možnost:
SELECT
id,
CASE WHEN value >= LAG(value, 1, value) OVER (PARTITION BY name ORDER BY meas_date)
THEN 0 ELSE 1 END AS flag
FROM yourTable