In many dialects of SQL it is valid to sort by attributes that are not present in the SELECT
clause. This rule detects such queries and adds the required attributes to the original
projection, so that they will be available during sorting. Another projection is added to
remove these attributes after sorting.
The HAVING clause could also used a grouping columns that is not presented in the SELECT.
In many dialects of SQL it is valid to sort by attributes that are not present in the SELECT clause. This rule detects such queries and adds the required attributes to the original projection, so that they will be available during sorting. Another projection is added to remove these attributes after sorting.
The HAVING clause could also used a grouping columns that is not presented in the SELECT.