Re: MAX() of 0 records.

From: "DalTech - Continuing Technical Education" <CTE(at)Dal(dot)Ca>
To: "Paul McGarry" <paulm(at)opentec(dot)com(dot)au>
Cc: "Pgsql-sql" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: MAX() of 0 records.
Date: 2000-07-07 12:44:53
Message-ID: 005601bfe811$263a3460$5911be86@cte.Dal.Ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers pgsql-sql

> 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Chris Bitmead 2000-07-07 15:35:02 Re: [HACKERS] Re: [SQL] MAX() of 0 records.
Previous Message Paul McGarry 2000-07-07 09:00:14 Re: [SQL] MAX() of 0 records.

Browse pgsql-hackers by date

  From Date Subject
Next Message Karel Zak 2000-07-07 13:09:30 Re: Per-database/schema settings
Previous Message The Hermit Hacker 2000-07-07 12:42:16 Re: proposed improvements to PostgreSQL license

Browse pgsql-sql by date

  From Date Subject
Next Message eisentrp 2000-07-07 13:14:07 Re: Re: [SQL] Re: [GENERAL] lztext and compression ratios...
Previous Message Patrick Jacquot 2000-07-07 09:44:30 Re: confused by select.