db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laura Stewart (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-264) This enhancement to allow expressions in ORDER BY clause will require documentation changes.
Date Mon, 19 Feb 2007 18:59:06 GMT

    [ https://issues.apache.org/jira/browse/DERBY-264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474254

Laura Stewart commented on DERBY-264:

Posted a separate request on derby-dev with the questions I needed help with.

Yip Ng responded with:

Yip Ng <yipng168@gmail.com>  to derby-dev 

On 2/16/07, Laura Stewart <scotsmatrix@gmail.com> wrote:

> 1. The type of expressions that are allowed. My impression is that
> they are the Boolean expressions (as opposed to TableExpressions or
> SelectExpressions)?

ORDER BY expression is not limited to boolean expression only.  It can contain
common value expression such as numeric, string, datetime, etc.  It can also
have row value expression such as a scalar subquery, case expression, etc.

> 2. I need to understand how the Syntax for ORDER BY should appear.
> Should it just be "Expressions" added immediately after ColumnPosition
> (in both places in the Syntax? Or should it be specific type of
> expression (TableExpression, SelectExpression, Boolean Expression).
> Are there limitations as to the types of expressions allowed? Boolean,
> concatenation?

Perhaps the name sort-key expression would be more appropriate?
Adding it after Column Position is fine.

> 3. Description of the expressions allowed (will appear below the
> syntax) This will depend on what type of expressions are allowed, but
> one thing that the other parameters mention is if the column needs to
> be in the select list. I need help describing the expressions
> parameter.

> 4. Whatever type of expressions are allowed, that topic in the Derby
> Ref Guide needs to be updated too. Are there any limitations for ORDER
> BY? For example, the Boolean expressions topic mentions that there are
> limitations with check constraints.

Yes, there are restrictions.  If SELECT DISTINCT is specified or the
SELECT statement contains a GROUP BY clause, the ORDER BY columns need
to appear in the SELECT list.

I think there is a bug in Derby in the DISTINCT with ORDER BY case and
I have filed a jira for this.  See DERBY-2351 for further details.

Hope this helps.


Yip Ng

> This enhancement to allow expressions in ORDER BY clause will require documentation changes.
> --------------------------------------------------------------------------------------------
>                 Key: DERBY-264
>                 URL: https://issues.apache.org/jira/browse/DERBY-264
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Documentation
>    Affects Versions:,
>            Reporter: Satheesh Bandaram
>         Assigned To: Laura Stewart
>            Priority: Minor
> I can help if needed for documenting this enhancement.

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

View raw message