Re: multiple count functions in a select statement

Поиск
Список
Период
Сортировка
От Oliver Elphick
Тема Re: multiple count functions in a select statement
Дата
Msg-id 1086035561.27765.89.camel@linda
обсуждение исходный текст
Ответ на multiple count functions in a select statement  ("Jeannie Stevenson" <webteam@wes-state.com>)
Ответы Re: multiple count functions in a select statement  (Mike Rylander <miker@purplefrog.com>)
Список pgsql-general
On Thu, 2004-05-27 at 17:38, Jeannie Stevenson wrote:
...
> In MSSQL I would use
>
> select
> count_1=(select count(ad_code) AS "CP" from leads where ad_code =
> '555'),
> count_2=(select count(ad_code) AS HED" from leads where ad_code =
> '222'),
> etc

SELECT
  (select count(ad_code) AS "CP"
     from leads where ad_code = '555') AS count_1,
  (select count(ad_code) AS HED"
     from leads where ad_code = '222') AS count_2,
...etc...

--
Oliver Elphick                                          olly@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
                 ========================================
     "How precious also are thy thoughts unto me, O God! how
      great is the sum of them! If I should count them, they
      are more in number than the sand; when I awake, I am
      still with thee."    Psalms 139: 17,18


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

Предыдущее
От: linhluong@canada.com
Дата:
Сообщение: pg_dump question
Следующее
От: "Philip A. Chapman"
Дата:
Сообщение: Re: Poatgresql database on more than one disk