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

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

Re: Is a "set current" TIMESTAMP operation atomic when updating/inserting multiple rows?

2006-07-23 Thread Dan Jakubiec
Ah, thanks Chris. I should have looked there (I was studying the TIMESTAMP sections, not NOW()). The NOW() documentation also refers to the SYSDATE() function which does the opposite (i.e. sets the time when the record actually gets added). So I'll go ahead and use the 'my_timestamp=NOW()' form

Is a "set current" TIMESTAMP operation atomic when updating/inserting multiple rows?

2006-07-23 Thread Dan Jakubiec
timestamp value? Or will some rows have "now", "now+1", and "now+2"? 2) Will the behavior be different if I use "my_timestamp=NOW()"? 3) If the timestamps will be different, what's the best way to make them all the same? Thanks in advance, -- Dan Jakubiec