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 "Bob Gibson (JIRA)" <de...@db.apache.org> on 2004/11/28 16:33:18 UTC

[jira] Created: (DERBY-84) Column aliasing could simplify queries

Column aliasing could simplify queries
--------------------------------------

         Key: DERBY-84
         URL: http://nagoya.apache.org/jira/browse/DERBY-84
     Project: Derby
        Type: New Feature
  Components: SQL  
    Versions: 10.0.2.0    
    Reporter: Bob Gibson
    Priority: Minor


Currently, one can not use an alias to simplify queries.  For example, being able to alias "LongDescriptiveColumnName" AS LDCN would allow one to use the alias elsewhere in the query, e.g., the WHERE clause:

SELECT LongDescriptiveColumnName AS LDCN FROM MyTable WHERE LDCN LIKE '%testing%';

The current result is a message like:

ERROR 42X04: Column 'LDCN' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'LDCN' is not a column in the target table.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-84) Column aliasing could simplify queries

Posted by "Jack Klebanoff (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-84?page=comments#action_66872 ]
     
Jack Klebanoff commented on DERBY-84:
-------------------------------------

I suspect that this is not a bug, that Derby is behaving correctly here according to the SQL standard.

The alias in the select list names the column in the virtual table produced by the SELECT. However Derby requires that where clause column references refer to columns in tables, views, or sub-queries listed in the FROM clause. In the bug report example LDCN is not a column in in any from list table, so Derby issues an error message when LDCN is used in the where clause.

My reading of the SQL2003 spec indicates that the Derby behavior follows the SQL standard. See the standard's discussion of identifier chains. The spec differentiates between identifiers used in ORDER BY clauses and identifiers used elsewhere. The spec says that (column) identifiers in a ORDER BY clause should be bound to the column names defined in the select list, but that other (column) identifiers should be bound to columns in tables in the FROM list.



> Column aliasing could simplify queries
> --------------------------------------
>
>          Key: DERBY-84
>          URL: http://issues.apache.org/jira/browse/DERBY-84
>      Project: Derby
>         Type: New Feature
>   Components: SQL
>     Versions: 10.0.2.0
>     Reporter: Bob Gibson
>     Priority: Minor

>
> Currently, one can not use an alias to simplify queries.  For example, being able to alias "LongDescriptiveColumnName" AS LDCN would allow one to use the alias elsewhere in the query, e.g., the WHERE clause:
> SELECT LongDescriptiveColumnName AS LDCN FROM MyTable WHERE LDCN LIKE '%testing%';
> The current result is a message like:
> ERROR 42X04: Column 'LDCN' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'LDCN' is not a column in the target table.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-84) Column aliasing could simplify queries

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Pendleton updated DERBY-84:
---------------------------------

    Attachment: simpleTest.diff

simpleTest.diff contains a simple addition to select.sql to
demonstrate the current (believed to be standards-compliant)
behavior of Derby with respect to column aliases in the WHERE clause.

I propose to commit this change and resolve this issue as won't-fix,
with the reasoning that we intend to preserve the standards-compliant
behavior in this area for now.


> Column aliasing could simplify queries
> --------------------------------------
>
>                 Key: DERBY-84
>                 URL: https://issues.apache.org/jira/browse/DERBY-84
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.0.2.0
>            Reporter: Bob Gibson
>            Assignee: Bryan Pendleton
>            Priority: Minor
>         Attachments: simpleTest.diff
>
>
> Currently, one can not use an alias to simplify queries.  For example, being able to alias "LongDescriptiveColumnName" AS LDCN would allow one to use the alias elsewhere in the query, e.g., the WHERE clause:
> SELECT LongDescriptiveColumnName AS LDCN FROM MyTable WHERE LDCN LIKE '%testing%';
> The current result is a message like:
> ERROR 42X04: Column 'LDCN' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'LDCN' is not a column in the target table.

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


[jira] Commented: (DERBY-84) Column aliasing could simplify queries

Posted by "Micah Spears (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-84?page=comments#action_57566 ]
     
Micah Spears commented on DERBY-84:
-----------------------------------

This issue is hindering Hibernate support.  HQL queries using 'group by' and 'having' clauses fail in cloudscape because hibernate uses column aliases.  An example is below.

HQL: select p.rxId from gov.va.med.predemo.local.pharmacy.db.pharmacy.hibernate.PatientPrescriptionDO as p, p.prescriptionStatusLogs as s group by p having max(s.statusId) = :status

SQL: select patientpre0_.RX_ID as x0_0_ from Pharmacy.PATIENT_PRESCRIPTION patientpre0_ inner join Pharmacy.PRESCRIPTION_STATUS_LOG prescripti1_ on patientpre0_.RX_ID=prescripti1_.RX_ID group by  patientpre0_.RX_ID having (max(prescripti1_.STATUS_ID)=? ) 

Message: com.ibm.db2.jcc.c.SqlException: Column 'PATIENTPRE0_.X0_0_' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'PATIENTPRE0_.X0_0_' is not a column in the target table.


If I remove 'patientpre0_.RX_ID as x0_0_', the query runs as expected.

> Column aliasing could simplify queries
> --------------------------------------
>
>          Key: DERBY-84
>          URL: http://issues.apache.org/jira/browse/DERBY-84
>      Project: Derby
>         Type: New Feature
>   Components: SQL
>     Versions: 10.0.2.0
>     Reporter: Bob Gibson
>     Priority: Minor

>
> Currently, one can not use an alias to simplify queries.  For example, being able to alias "LongDescriptiveColumnName" AS LDCN would allow one to use the alias elsewhere in the query, e.g., the WHERE clause:
> SELECT LongDescriptiveColumnName AS LDCN FROM MyTable WHERE LDCN LIKE '%testing%';
> The current result is a message like:
> ERROR 42X04: Column 'LDCN' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'LDCN' is not a column in the target table.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-84) Column aliasing could simplify queries

Posted by "Jack Klebanoff (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-84?page=comments#action_64077 ]
     
Jack Klebanoff commented on DERBY-84:
-------------------------------------

The problem described by Bob Gibson in the main body of this report and the problem described by Micah Spears in his comment of 12/Jan/05 seem different to me.

This bug report complains that Derby does _not_ support the use of column aliases in WHERE clauses.

The problem described in the 12/Jan/05 comment is that Derby _requires_ the use of column aliases in an ORDER BY clause for columns that have aliases. The comment complains that Derby should, but currently does not, allow the original column names in an ORDER BY clause if the column has an alias. I think that the 12/Jan/05 comment is a duplicate of Derby-127, but this bug report (Derby-84) is different.

> Column aliasing could simplify queries
> --------------------------------------
>
>          Key: DERBY-84
>          URL: http://issues.apache.org/jira/browse/DERBY-84
>      Project: Derby
>         Type: New Feature
>   Components: SQL
>     Versions: 10.0.2.0
>     Reporter: Bob Gibson
>     Priority: Minor

>
> Currently, one can not use an alias to simplify queries.  For example, being able to alias "LongDescriptiveColumnName" AS LDCN would allow one to use the alias elsewhere in the query, e.g., the WHERE clause:
> SELECT LongDescriptiveColumnName AS LDCN FROM MyTable WHERE LDCN LIKE '%testing%';
> The current result is a message like:
> ERROR 42X04: Column 'LDCN' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'LDCN' is not a column in the target table.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-84) Column aliasing could simplify queries

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596553#action_12596553 ] 

Bryan Pendleton commented on DERBY-84:
--------------------------------------

I intend to add a few more tests to the test suite, to demonstrate the
current handling of column aliases in WHERE clauses, and then to
resolve this issue as "won't fix". 

See the discussion in DERBY-2457 for some additional comments
regarding the reasoning behind this proposal.

> Column aliasing could simplify queries
> --------------------------------------
>
>                 Key: DERBY-84
>                 URL: https://issues.apache.org/jira/browse/DERBY-84
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.0.2.0
>            Reporter: Bob Gibson
>            Assignee: Bryan Pendleton
>            Priority: Minor
>
> Currently, one can not use an alias to simplify queries.  For example, being able to alias "LongDescriptiveColumnName" AS LDCN would allow one to use the alias elsewhere in the query, e.g., the WHERE clause:
> SELECT LongDescriptiveColumnName AS LDCN FROM MyTable WHERE LDCN LIKE '%testing%';
> The current result is a message like:
> ERROR 42X04: Column 'LDCN' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'LDCN' is not a column in the target table.

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


[jira] Assigned: (DERBY-84) Column aliasing could simplify queries

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Pendleton reassigned DERBY-84:
------------------------------------

    Assignee: Bryan Pendleton

> Column aliasing could simplify queries
> --------------------------------------
>
>                 Key: DERBY-84
>                 URL: https://issues.apache.org/jira/browse/DERBY-84
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.0.2.0
>            Reporter: Bob Gibson
>            Assignee: Bryan Pendleton
>            Priority: Minor
>
> Currently, one can not use an alias to simplify queries.  For example, being able to alias "LongDescriptiveColumnName" AS LDCN would allow one to use the alias elsewhere in the query, e.g., the WHERE clause:
> SELECT LongDescriptiveColumnName AS LDCN FROM MyTable WHERE LDCN LIKE '%testing%';
> The current result is a message like:
> ERROR 42X04: Column 'LDCN' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'LDCN' is not a column in the target table.

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


[jira] Commented: (DERBY-84) Column aliasing could simplify queries

Posted by "Shreyas Kaushik (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-84?page=comments#action_66956 ]
     
Shreyas Kaushik commented on DERBY-84:
--------------------------------------

So, can this be closed ? Should the hibernate group be informed about the way they generate queries to take care of this ?
BTW have a look at this link, http://www.hibernate.org/80.392.html

> Column aliasing could simplify queries
> --------------------------------------
>
>          Key: DERBY-84
>          URL: http://issues.apache.org/jira/browse/DERBY-84
>      Project: Derby
>         Type: New Feature
>   Components: SQL
>     Versions: 10.0.2.0
>     Reporter: Bob Gibson
>     Priority: Minor

>
> Currently, one can not use an alias to simplify queries.  For example, being able to alias "LongDescriptiveColumnName" AS LDCN would allow one to use the alias elsewhere in the query, e.g., the WHERE clause:
> SELECT LongDescriptiveColumnName AS LDCN FROM MyTable WHERE LDCN LIKE '%testing%';
> The current result is a message like:
> ERROR 42X04: Column 'LDCN' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'LDCN' is not a column in the target table.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-84) Column aliasing could simplify queries

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597340#action_12597340 ] 

Bryan Pendleton commented on DERBY-84:
--------------------------------------

Committed the simple test to the trunk as revision 656929.

> Column aliasing could simplify queries
> --------------------------------------
>
>                 Key: DERBY-84
>                 URL: https://issues.apache.org/jira/browse/DERBY-84
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.0.2.0
>            Reporter: Bob Gibson
>            Assignee: Bryan Pendleton
>            Priority: Minor
>         Attachments: simpleTest.diff
>
>
> Currently, one can not use an alias to simplify queries.  For example, being able to alias "LongDescriptiveColumnName" AS LDCN would allow one to use the alias elsewhere in the query, e.g., the WHERE clause:
> SELECT LongDescriptiveColumnName AS LDCN FROM MyTable WHERE LDCN LIKE '%testing%';
> The current result is a message like:
> ERROR 42X04: Column 'LDCN' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'LDCN' is not a column in the target table.

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


[jira] Resolved: (DERBY-84) Column aliasing could simplify queries

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Pendleton resolved DERBY-84.
----------------------------------

    Resolution: Won't Fix

For the time being, we intend to preserve Derby's current behavior,
as we believe it to be standards-compliant, and adhering to the
SQL standard seems important for this case.


> Column aliasing could simplify queries
> --------------------------------------
>
>                 Key: DERBY-84
>                 URL: https://issues.apache.org/jira/browse/DERBY-84
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.0.2.0
>            Reporter: Bob Gibson
>            Assignee: Bryan Pendleton
>            Priority: Minor
>         Attachments: simpleTest.diff
>
>
> Currently, one can not use an alias to simplify queries.  For example, being able to alias "LongDescriptiveColumnName" AS LDCN would allow one to use the alias elsewhere in the query, e.g., the WHERE clause:
> SELECT LongDescriptiveColumnName AS LDCN FROM MyTable WHERE LDCN LIKE '%testing%';
> The current result is a message like:
> ERROR 42X04: Column 'LDCN' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'LDCN' is not a column in the target table.

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


[jira] Commented: (DERBY-84) Column aliasing could simplify queries

Posted by "Shreyas Kaushik (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-84?page=comments#action_66828 ]
     
Shreyas Kaushik commented on DERBY-84:
--------------------------------------

Without the where clause this works, looks like a binding issue

ij> connect 'jdbc:derby:test';
ij> drop table test;
0 rows inserted/updated/deleted
ij> create table test(i int, longcolname varchar(10));
0 rows inserted/updated/deleted
ij> insert into test values(1,'abcd');
1 row inserted/updated/deleted
ij> select longcolname as lc from test where lc like '%ab%';
ERROR 42X04: Column 'LC' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'LC' is not a column in the target table.
ij> select longcolname as lc from test;
LC
----------
abcd

1 row selected


> Column aliasing could simplify queries
> --------------------------------------
>
>          Key: DERBY-84
>          URL: http://issues.apache.org/jira/browse/DERBY-84
>      Project: Derby
>         Type: New Feature
>   Components: SQL
>     Versions: 10.0.2.0
>     Reporter: Bob Gibson
>     Priority: Minor

>
> Currently, one can not use an alias to simplify queries.  For example, being able to alias "LongDescriptiveColumnName" AS LDCN would allow one to use the alias elsewhere in the query, e.g., the WHERE clause:
> SELECT LongDescriptiveColumnName AS LDCN FROM MyTable WHERE LDCN LIKE '%testing%';
> The current result is a message like:
> ERROR 42X04: Column 'LDCN' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'LDCN' is not a column in the target table.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (DERBY-84) Column aliasing could simplify queries

Posted by Shreyas Kaushik <Sh...@Sun.COM>.
If everyone is fine I will close this.

~Shreyas

Jack Klebanoff (JIRA) wrote:

>    [ http://issues.apache.org/jira/browse/DERBY-84?page=comments#action_67015 ] 
>
>Jack Klebanoff commented on DERBY-84:
>-------------------------------------
>
>I think that this issue can be closed.
>
>The Hibernate/Derby issue that Micah Spears referred to in his comment is different than this Jira entry's issue. I believe that that issue was a Derby bug and that it has been fixed.
>
>  
>
>>Column aliasing could simplify queries
>>--------------------------------------
>>
>>         Key: DERBY-84
>>         URL: http://issues.apache.org/jira/browse/DERBY-84
>>     Project: Derby
>>        Type: New Feature
>>  Components: SQL
>>    Versions: 10.0.2.0
>>    Reporter: Bob Gibson
>>    Priority: Minor
>>    
>>
>
>  
>
>>Currently, one can not use an alias to simplify queries.  For example, being able to alias "LongDescriptiveColumnName" AS LDCN would allow one to use the alias elsewhere in the query, e.g., the WHERE clause:
>>SELECT LongDescriptiveColumnName AS LDCN FROM MyTable WHERE LDCN LIKE '%testing%';
>>The current result is a message like:
>>ERROR 42X04: Column 'LDCN' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'LDCN' is not a column in the target table.
>>    
>>
>
>  
>

[jira] Commented: (DERBY-84) Column aliasing could simplify queries

Posted by "Jack Klebanoff (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-84?page=comments#action_67015 ] 

Jack Klebanoff commented on DERBY-84:
-------------------------------------

I think that this issue can be closed.

The Hibernate/Derby issue that Micah Spears referred to in his comment is different than this Jira entry's issue. I believe that that issue was a Derby bug and that it has been fixed.

> Column aliasing could simplify queries
> --------------------------------------
>
>          Key: DERBY-84
>          URL: http://issues.apache.org/jira/browse/DERBY-84
>      Project: Derby
>         Type: New Feature
>   Components: SQL
>     Versions: 10.0.2.0
>     Reporter: Bob Gibson
>     Priority: Minor

>
> Currently, one can not use an alias to simplify queries.  For example, being able to alias "LongDescriptiveColumnName" AS LDCN would allow one to use the alias elsewhere in the query, e.g., the WHERE clause:
> SELECT LongDescriptiveColumnName AS LDCN FROM MyTable WHERE LDCN LIKE '%testing%';
> The current result is a message like:
> ERROR 42X04: Column 'LDCN' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'LDCN' is not a column in the target table.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-84) Column aliasing could simplify queries

Posted by "Alex Miller (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-84?page=comments#action_12366501 ] 

Alex Miller commented on DERBY-84:
----------------------------------

I agree that this matches the SQL spec.  The ORDER BY column is conceptually executed after the SELECT clause and works on the output names defined in the SELECT clause.  All other clauses are logically evaluated *before* the SELECT clause and thus cannot use the output column names defined by the SELECT clause.  Of course, many dbs are more tolerant about what can occur, particularly about what can occur in the ORDER BY.

> Column aliasing could simplify queries
> --------------------------------------
>
>          Key: DERBY-84
>          URL: http://issues.apache.org/jira/browse/DERBY-84
>      Project: Derby
>         Type: New Feature
>   Components: SQL
>     Versions: 10.0.2.0
>     Reporter: Bob Gibson
>     Priority: Minor

>
> Currently, one can not use an alias to simplify queries.  For example, being able to alias "LongDescriptiveColumnName" AS LDCN would allow one to use the alias elsewhere in the query, e.g., the WHERE clause:
> SELECT LongDescriptiveColumnName AS LDCN FROM MyTable WHERE LDCN LIKE '%testing%';
> The current result is a message like:
> ERROR 42X04: Column 'LDCN' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'LDCN' is not a column in the target table.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira