You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Bryan Pendleton (JIRA)" <ji...@apache.org> on 2008/04/26 18:02:55 UTC

[jira] Commented: (DERBY-2457) Use of column aliases in group by / having clauses can cause queries to fail

    [ https://issues.apache.org/jira/browse/DERBY-2457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592579#action_12592579 ] 

Bryan Pendleton commented on DERBY-2457:
----------------------------------------

This seems fairly similar to DERBY-2351, in which we established a set of rules
for how to resolve column references in ORDER BY clauses. The resolution
rules use a search path and thus can handle both the use of aliases as well
as the use of underlying column names, and distinguish ambiguous cases
depending on whether the column reference was qualified or unqualified.

It seems like something similar could work effectively for column references
in GROUP BY and HAVING clauses.

I'll have a look at the work we did in DERBY-2351, and the queries in 1624_repro.sql,
and see if the same, or similar, techniques could be used here.


> Use of column aliases in group by / having clauses can cause queries to fail
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-2457
>                 URL: https://issues.apache.org/jira/browse/DERBY-2457
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.3.1.4
>            Reporter: Andrew McIntyre
>            Priority: Minor
>         Attachments: 1624_repro.sql
>
>
> Some use of column aliases in group by / having clauses can cause queries to fail with error 42X04. The queries can sometimes be made to work by also aliasing the table or rewriting the query to use a subselect. Attached is a simple sql script which reproduces the issue, originally found as part of DERBY-1624.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.