In the last episode (Jun 19), Scott Haneda said:
> SELECT 1+1 as foo, 2 as bar, foo+bar
> 
> This will not work, but I think you can see what I am trying to do. 
> I need to run a pretty hefty update on a database, and there are some
> pretty heavy calculations I will be doing.  The result of many of
> those, needs to be further used to make updates on other columns.
> 
> Can someone suggest a method to do this so my SQL is not so non-manageable?

User variables?

mysql> SELECT @foo:=1+1 as foo, @bar:=2 as bar, @[EMAIL PROTECTED] as foobar;
+-----+-----+--------+
| foo | bar | foobar |
+-----+-----+--------+
|   2 |   2 |      4 | 
+-----+-----+--------+

-- 
        Dan Nelson
        [EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to