I was looking thru the postgresql message archive searching for a solution to my problem... which you articulated quit well... if you have max(key) of an empty table, the result set is {   } which when added to anything gives you {    } 
 
do you know how make the result of max(key) of a empty table return 0 we have tried writing our oun c funtion :


int
newmax (int arg,int arg2) {
  if (arg2==0)
  {
        return (arg2);
  }
  else
  {
        return(arg);
  }
}
 
 
we call it :
 
select newmax(max({key}), Count({key})) which returns us {     }
if we call it w/   select newmax(3,0))  returns 0
if we call it w/   select newmax(12,4))  returns 4
 
it does not work on an empty table :(
 
please help...
 
 
-Deva Vejay
devavejay@preveho.com









I was looking thru the postgresql message 
archive searching for a solution to my problem... which you articulated quit 
well... if you have max(key) of an empty table, the result set is {   
} which when added to anything gives you {    } 
 
do you know how make the result of max(key) of a empty table 
return 0 we have tried writing our oun c funtion :
 
 
intnewmax (int arg,int arg2) {  if 
(arg2==0)  {        return 
(arg2);  }  else  
{        return(arg);  
}}
 
 
we call it :
 
select newmax(max({key}), Count({key})) which 
returns us {     }
if we call it w/   select newmax(3,0))  returns 0
if we call it 
w/   select newmax(12,4))  returns 
4
 
it does not work on an empty table :(
 
please help...
 
 
-Deva Vejay
devavejay@preveho.com
Tue, 22 Jun 1999 14:17:12 -0400
"Deva Vejay" <devavejay@preveho.com>
PostgreSql HELP!