When we use alias in parent table like below
select movie.film_id, title, release_year "year",
language_id,rental_duration,rental_rate,replacement_cost, film_rating_id, stars
from film movie,
film_rating
where movie.film_id = film_rating.film_id
Order by clause constructs the invalid query as below
select movie.film_id, title, release_year "year",
language_id,rental_duration,rental_rate,replacement_cost, film_rating_id, stars
from film movie,
film_rating
where movie.film_id = film_rating.film_id AND film.release_year = 2012 ORDER BY film.film_id
I tested this with Postgres database. To test with other database to decide this is common to all database or specific to Postgres, I will do pull request by modifying a test case.
When we use alias in parent table like below
Order by clause constructs the invalid query as below
I tested this with Postgres database. To test with other database to decide this is common to all database or specific to Postgres, I will do pull request by modifying a test case.