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 "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2009/04/26 19:48:30 UTC

[jira] Commented: (DERBY-4099) Update Multiple Columns SQL

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

Knut Anders Hatlen commented on DERBY-4099:
-------------------------------------------

As far as I can tell, Derby's behaviour is in accordance with the SQL standard, whereas MySQL's behaviour is not. (PostgreSQL behaves the same way as Derby, by the way.)

>From ISO/IEC 9075-2:2003 - 14.11 <update statement: searched> - General Rules:

9) The <update source> of each <set clause> is effectively evaluated for each row of T before any row of T
is updated.

> Update Multiple Columns SQL
> ---------------------------
>
>                 Key: DERBY-4099
>                 URL: https://issues.apache.org/jira/browse/DERBY-4099
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Meenakshi Sundar Sitaraman
>            Priority: Critical
>
> When I try to execute the following query
> update table_name set n1=5, average=(n1+n2)/2 where ....
> The new value of n1 (viz. 5 in this case) is not used when calculating the average. While the new value of n1 is used in MySQL, the old value is used in Derby.
> Appreciate your support in resolving this issue.

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