Re: MAX() of 0 records.

Continuing Technical Education <cte@dal.ca>

From: "DalTech - Continuing Technical Education" <CTE@Dal.Ca>
To: "Paul McGarry" <paulm@opentec.com.au>
Cc: "Pgsql-sql" <pgsql-sql@postgresql.org>
Date: 2000-07-07T12:44:53Z
Lists: pgsql-bugs, pgsql-hackers
> UPDATE entry_stats 
> SET entry_maxprice=MAX(item_price) 
> FROM item 
> WHERE item.item_entry_id=NEW.item_entry_id
>   AND item.item_live = 't';

Try

COALESCE(MAX(item_price),0)

Christopher J.D. Currie
Computer Technician
Dalhousie: DalTech - CTE
_____________________________________________
Lord, deliver me from the man who never makes a mistake,
and also from the man who makes the same mistake twice.
-William James Mayo