Re: REPOST: Trouble with SQL conversion

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: REPOST: Trouble with SQL conversion
Дата
Msg-id 20020411212639.C68173-100000@houston.familyhealth.com.au
обсуждение исходный текст
Ответ на REPOST: Trouble with SQL conversion  ("Richard Ellerbrock" <richarde@eskom.co.za>)
Список pgsql-sql
> 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 по дате отправления:

Предыдущее
От: "Samuel J. Sutjiono"
Дата:
Сообщение: Transactional vs. Read-only (Retrieval) database
Следующее
От: Rajesh Kumar Mallah
Дата:
Сообщение: using output of a subselect in LIKE/ILIKE