Re: Computing a column based on other columns

2006-09-11 Thread Alvaro Cobo
Hi Dan: Not very sure, but you could try exploring "user variables": http://dev.mysql.com/doc/refman/5.0/en/user-variables.html Regards, Alvaro Cobo Dan Jakubiec escribió: > Hi Chris, > > On 9/10/06, Chris W <[EMAIL PROTECTED]> wrote: >> >> This works on a table I have. >> >> SELECT MIN(tone)

Re: Computing a column based on other columns

2006-09-11 Thread Dan Jakubiec
Hi Chris, On 9/10/06, Chris W <[EMAIL PROTECTED]> wrote: This works on a table I have. SELECT MIN(tone) as `min`, MAX(tone) as `max`, MIN(tone)/MAX(tone) as ratio FROM pltone p Thanks for the suggestion. This works for me too, but what I'm really looking for is a way to *alias* the first t

Re: Computing a column based on other columns

2006-09-10 Thread Chris W
Dan Jakubiec wrote: Hello, Is there a way to generate a column which computes a value from other columns in the same query? For example, I want to do something similar to: SELECT MIN(table.myvalue) as min, MAX(table.myvalue) as max, min/max as derived_column FROM table ORDER BY derived

Computing a column based on other columns

2006-09-10 Thread Dan Jakubiec
Hello, Is there a way to generate a column which computes a value from other columns in the same query? For example, I want to do something similar to: SELECT MIN(table.myvalue) as min, MAX(table.myvalue) as max, min/max as derived_column FROM table ORDER BY derived_column ; But MySQL doe