Bugs item #1876779, was opened at 2008-01-21 16:48
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1876779&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQL/Core
Group: MonetDB5 CVS Head
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Bob Ippolito (etrepum)
Assigned to: Niels Nes (nielsnes)
Summary: Unexpected results with COALESCE and aggregates

Initial Comment:
MonetDB SR5 behaves unexpectedly when we've tried to use COALESCE with
aggregates, here's an example:

sql>CREATE TABLE tmp(a int);
sql>SELECT SUM(a) FROM tmp;
+-------+
| sum_a |
+=======+
| 0     |
+-------+
sql>SELECT MIN(a) FROM tmp;
+-------------+
| min_a       |
+=============+
|        null |
+-------------+
sql>SELECT COALESCE(MIN(a), 0) FROM tmp;
sql>

For the first SELECT I would expect NULL, the second SELECT is okay,
but I expect a result for the third!

Here's what PosgreSQL does:

bob=# CREATE TABLE tmp(a int);
CREATE TABLE
bob=# SELECT SUM(A) FROM tmp;
 sum
-----

(1 row)

bob=# SELECT MIN(a) FROM tmp;
 min
-----

(1 row)

bob=# SELECT COALESCE(MIN(a), 0) FROM tmp;
 coalesce
----------
       0

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1876779&group_id=56967

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to