Re: How can I do something like this in mySQL...

2007-04-08 Thread John Kopanas
Sweet... thanks guys... it is working well now :-). On 4/8/07, Mogens Melander <[EMAIL PROTECTED]> wrote: Well, maybe you want to read up on isnull() and case (..) in the manual. It's in there, somewhere. mysql> SELECT CASE 1 WHEN 1 THEN 'one' -> WHEN 2 THEN 'two' ELSE 'more' END;

Re: How can I do something like this in mySQL...

2007-04-07 Thread Mogens Melander
Well, maybe you want to read up on isnull() and case (..) in the manual. It's in there, somewhere. mysql> SELECT CASE 1 WHEN 1 THEN 'one' -> WHEN 2 THEN 'two' ELSE 'more' END; -> 'one' mysql> SELECT CASE WHEN 1>0 THEN 'true' ELSE 'false' END; -> 'true' mysql> SELECT CASE BI

Re: How can I do something like this in mySQL...

2007-04-07 Thread John Meyer
John Kopanas wrote: I have a query that looks something like this: SELECT (c_o_w_inst_rev - c_o_w_estcost)/c_o_w_inst_rev FROM tmpGovernmentSummaries The problem is that sometimes c_o_w_inst_rev is 0 and dividing by zero returns a NULL. If c_o_w_inst_rev == 0 how can I return 0 for the SELECT

How can I do something like this in mySQL...

2007-04-07 Thread John Kopanas
I have a query that looks something like this: SELECT (c_o_w_inst_rev - c_o_w_estcost)/c_o_w_inst_rev FROM tmpGovernmentSummaries The problem is that sometimes c_o_w_inst_rev is 0 and dividing by zero returns a NULL. If c_o_w_inst_rev == 0 how can I return 0 for the SELECT above instead of NULL