I'm trying to learn Postgresql with the help of this website https://www.postgresqltutorial.com. But I'm confused in the order of operations.So I compared the order they say in this site with others, all are same to each other. In some queries the order of operations works as they mentioned like this one:
select customer_id C
from payment
where C > 10
and I got error that the alias (C) is not recognized as I expected because of the order of execution:
FROM -> WHERE -> SELECT
The problem is here:
select
customer_id C
from payment
where customer_id > 10
group by C
and it works fine without any error! Postgresql knows what C is inside the group by clause But the operation execution order here is not what it should be:
FROM -> WHERE -> GROUP BY -> SELECT
So Postgresql knows what C is before select clause executes? how?