SELECT status,sum(case when next_index_time<=%d
then 1 else 0 end),count(*)
FROM url WHERE 1=1 %s%s%s GROUP 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(at)hub(dot)org secondary: scrappy(at){freebsd|postgresql}.org