Re: REPOST: Trouble with SQL conversion

Поиск
Список
Период
Сортировка
От Richard Ellerbrock
Тема Re: REPOST: Trouble with SQL conversion
Дата
Msg-id scb5c513.037@eskom.co.za
обсуждение исходный текст
Ответ на REPOST: Trouble with SQL conversion  ("Richard Ellerbrock" <richarde@eskom.co.za>)
Список pgsql-sql
I am an idiot! Actually your suggestion does work - it would help to do
it against a customer that actually has records!

>>> Christopher Kings-Lynne <chriskl@familyhealth.com.au> 2002/04/11
03:28:32 >>>
> SELECT base.baseindex, base.subnetsize, base.descrip, base.baseaddr,
> base.admingrp, count(ipaddr.baseindex) AS cnt FROM base
> LEFT JOIN ipaddr ON base.baseindex=ipaddr.baseindex WHERE
> base.baseaddr
> BETWEEN 2473473024 AND 2473473151 AND base.customer=1
> GROUP BY base.baseindex
> ORDER BY base.baseaddr;

> 0: ERROR: Attribute base.subnetsize must be GROUPed or used in an
> aggregate function

Do what it says.  Add base.subnetsize to the GROUP BY.  You'll
probably
need to add base.descrip, base.baseaddr and base.admingrp as well.

Chris



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

Предыдущее
От: Rajesh Kumar Mallah
Дата:
Сообщение: Re: using output of a subselect in LIKE/ILIKE
Следующее
От: Christopher Kings-Lynne
Дата:
Сообщение: Re: REPOST: Trouble with SQL conversion