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 { }
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера