If you refer column alias in the where caluse, you will get the error:
SELECT YEAR(transaction_date) AS YEAR,amount FROM dev.sale
WHERE YEAR=2019
You get the error
Invalid column name ‘year’.
It is because the column alias are not immediately known to the WHERE clause.