RE: [GENERAL] select and join

Поиск
Список
Период
Сортировка
От Taral
Тема RE: [GENERAL] select and join
Дата
Msg-id 000701bdfeae$6ea4ca60$3b291f0a@taral
обсуждение исходный текст
Ответ на select and join  (ZioBudda <michel@michel.enter.it>)
Список pgsql-general
> i have make this try:
> esame=> select utente.cognome, prestito.id_utente, libro.tipo,
> count(*) from prestito, libro where libro.id_libro =
> prestito.id_libro and utente.id_utente = prestito.id_utente group
> by id_utente, tipo\g
>
> but the output is :
> ERROR:  parser: illegal use of aggregates or non-group column in
> target list

I keep seeing this... When doing something like this, you must have ALL
non-aggregate columns in the GROUP BY.

So: (note you also forgot to update the FROM)

SELECT utente.cognome, prestito.id_utente, libro.tipo, count(*) FROM
prestito, libro, utente WHERE libro.id_libro = prestito.id_libro AND
utente.id_utente = prestito.id_utente GROUP BY cognome, id_utente, tipo;

Taral


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

Предыдущее
От: ZioBudda
Дата:
Сообщение: date null
Следующее
От: "Taral"
Дата:
Сообщение: RE: [GENERAL] date null