SELECT status,sum(case when next_index_time<=%d then 1 else 0 end),count(*) FROM url WHERE 1=1
%s%s%sGROUP BY status;
There may not be enough info here to answer, but the 'case/then/else/end'
just looks weird to me...
Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org