Skip to content

Order by clause failing when alias used for table name #64

Description

@mookkiah

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions