Hi All,

I think I had read this question with count(*) before.....

PgSql returns one row with a null field when we use select MIN or MAX on a
table, but the result should be "no rows selected".

I didn't try with C function, but I got the same result with psql.

So, I'm sending a Java example to Peter.

try {
    rs=stmt.executeQuery("select min(field1) from tab where
field1>maxValueOfField1");
    if (rs.next()) {
        System.out.println("I found a row !!!!");
        theResult=rs.getString(1);
        if (theResult==null)
            System.out.println("Min of field1 is NULL !!!!");
    }
} catch (.............

maxValueofField1 = select max(field1) from tab;

Is it correct ?

I'm using PgSql 6.5.2, RHLinux/Intel 6.0

Thanks,

Ricardo Coelho.




Wed, 17 Nov 1999 08:08:51 -0200
"Ricardo Coelho" <rcoelho@px.com.br>
select MIN/MAX when no row selected