Minimum date handling

I had the dubious pleasure of debugging an ABF program
(not mine) that was producing unpredictable (at least until the 
problem was identified) results.

The cause was the misunderstanding of how Ingres handles
the MIN function on date fields.  The particular installation
uses an "empty" date end field to identify an on-going period
rather than suffer through the use of NULL fields.  The misconception
uniformly through the office was that given the situation below
the select min(date field) would/should have returned the empty field.

The question I have is - is the observed result correct in terms of 
SQL function definitions or is it a known problem in Ingres?
Same result is observed for Ingres 6.4/04 HP-UX and 6.4/01 SCO UNIX

  1> help tmp
...
Column Name                      Type       Length Nulls Defaults Seq
d1                               date                no     yes   
f1                               integer         4   no     yes   

  2> select * from tmp
+-------------------------+-------------+
|d1                       |f1           |
+-------------------------+-------------+
|                         |            1|
|24/10/94                 |            2|
+-------------------------+-------------+

  2> select min( d1 ), min(f1) from tmp
+-------------------------+-------------+
|col1                     |col2         |
+-------------------------+-------------+
|24/10/94                 |            1|
+-------------------------+-------------+

Comments please
    +-----------------------------------------------------------+ 
    |    _-_|\   Frederick W. Myers     Voice ++61 (98) 512 119	|
    |   /     \  Diamond State Data Services	      		|
    |   \*.-._/  187 Mondurup St Mt Barker WA 6324 Australia	|
    |        v   	fredwm@perth.dialix.oz.au  		|
    +-----------------------------------------------------------+ 
Ingres Q & A
To William's Home Page

© William Yuan 2000

Email William