SELECT key, valuea, sun(valueb) from table order by key where between(date,startdate,enddate) into array aMy problem is that I can get 1 to 3 rows in the array depending on the data. What I want is to always get 3 rows with zero for non-existant values. For example assume only key2 has a data. I then want the result like
key1 0 key2 12 key3 0What is the best way of doing this?