Re: Group By Error Text

Поиск
Список
Период
Сортировка
Искать
От
Josh Berkus
Тема
Re: Group By Error Text
Дата
Msg-id
200301191446.39772.josh@agliodbs.com
Ответ на
Group By Error Text (Joseph Healy)
Список
Дерево обсуждения
Group By Error Text Joseph Healy <j.healy@ugrad.unimelb.edu.au>
Re: Group By Error Text Josh Berkus <josh@agliodbs.com>

Joe,

> ERROR:  Attribute drawing_register.jobno must be GROUPed or used in an
> aggregate function
> 
> Is this correct? Getting rid of the error is easy:
> 
> select jobno, count(jobno) from drawing_register group by jobno;
> 
> I believe that jobno is being used in an aggregate function. Should a
> change be made to the error text?

Nope.  The error message is exactly correct.   If you didn't want to GROUP BY 
jobno, then what you actually wanted to query was:

SELECT count(jobno) FROM drawing_register;

-- 
-Josh BerkusAglio Database SolutionsSan Francisco


В списке pgsql-sql по дате отправления
От: Joseph Healy
Дата:
Сообщение: Group By Error Text
От: D'Arcy J.M. Cain
Дата:
FAQ