One query for two information...

Поиск
Список
Период
Сортировка
От Ed
Тема One query for two information...
Дата
Msg-id 001d01bfa942$13d93180$b48c29d1@citenet.net
обсуждение исходный текст
Список pgsql-sql
Hi,

I have a table containing only a bool filed.  I would like to know how many
records there is an on many ar true.

Is there something I could do to get both answer in only one query...   like
:

select count(*), sum(bool_col) from tablename

but there is no sum(bool) function that would add 1 if it's true and 0 if
it's false... ;(

Any idea?

Frédéric Boucher
dziablo@lords.com




В списке pgsql-sql по дате отправления:

Предыдущее
От:
Дата:
Сообщение: Re: DELETE FROM tableA WHERE NOT IN tableB ...
Следующее
От: Michael Ansley
Дата:
Сообщение: RE: DELETE FROM tableA WHERE NOT IN tableB ...