When I run this query I get more rows than from a similar query without the ROW_NUMBER ()
line:
SELECT DISTINCT id, value,
ROW_NUMBER () OVER (PARTITION BY (id)
ORDER BY value DESC NULLS LAST ) max
FROM TABLE1
WHERE id like '%1260' ORDER BY id ASC
VS
SELECT DISTINCT id, value
FROM TABLE1
WHERE id like '%1260' ORDER BY id ASC
Why does it happen and how to fix it?