Hvis din version af Oracle understøtter LAG
så er der en nem mulighed:
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
Hvis din version af Oracle understøtter LAG
så er der en nem mulighed:
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