[Info-ingres] Question on min() and nullability

Karl Schendel schendel at kbcomputer.com
Thu Oct 29 13:10:35 UTC 2020



> On Oct 29, 2020, at 9:08 AM, Martin Bowes <martin.bowes at ndph.ox.ac.uk> wrote:
> 
> select ii_dv_desc(min(a)) from session.test
> Executing . . .
>  
>  
> ┌──────────────────────────────────────────────────────────────┐
> │col1                                                          │
> ├──────────────────────────────────────────────────────────────┤
> │nullable ingresdate                                           │
> └──────────────────────────────────────────────────────────────┘
> (1 row)
>  
> How can the min of a non nullable field ever itself be a null?
>  

Because it's an aggregate.  min can be null if there are no rows.

Karl



More information about the Info-ingres mailing list