I return a table with position:
select *
from (
select *, row_number() over() as position
from organization
) result
where data1 = 'Hello';
Gives back this, which is correct:
data1 | Hello
data2 | Joe
position | 5
But when I do:
select position
from (
select *, row_number() over() as position
from organization
) result
where data1 = 'Hello';
It returns:
position | 25
What am missing here? How can I modify this query to return 5?
ORDER BYclause. Without it the result is arbitrary.