In article [EMAIL PROTECTED],
Michael Fuhr [EMAIL PROTECTED] writes:
On Mon, Mar 21, 2005 at 12:35:22AM -0600, Thomas F.O'Connell wrote:
The number of lines depends merely on where you place your line breaks.
IF(days_complete = 120, job_price, 0)AS Days_120
could be written as:
CASE
Hello all.
In the tail end of converting an app from MySQL to psql. I have this code :
snip
IF(days_complete = -120, job_price,0) AS Days_120,
IF(days_complete BETWEEN -119 AND -90, job_price,0) AS Days_90,
IF(days_complete BETWEEN -89 AND -60, job_price,0) AS Days_60,
IF(days_complete BETWEEN -59
The number of lines depends merely on where you place your line breaks.
IF(days_complete = 120, job_price, 0)AS Days_120
could be written as:
CASE WHEN days_complete = 120 THEN job_price ELSE 0 END AS Days_120
There might be somewhat less syntactic sugar, but this is not a five
line expression
On Mon, Mar 21, 2005 at 12:35:22AM -0600, Thomas F.O'Connell wrote:
The number of lines depends merely on where you place your line breaks.
IF(days_complete = 120, job_price, 0)AS Days_120
could be written as:
CASE WHEN days_complete = 120 THEN job_price ELSE 0 END AS Days_120
There