| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера