Обсуждение: Could this be done better...?

Поиск
Список
Период
Сортировка

Could this be done better...?

От
The Hermit Hacker
Дата:
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