Re: joining 2 Tables.

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: joining 2 Tables.
Дата
Msg-id 1395095924101-5796463.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: joining 2 Tables.  (Thomas Drebert <drebert@web.de>)
Список pgsql-novice
Thomas Drebert wrote
> Hello,
>
> if i use the *,  I get an error message.
>
> ERROR:  column "n2.thecount" must appear in the GROUP BY clause or be used
> in an aggregate function
> ********** Fehler **********
>
> ERROR: column "n2.thecount" must appear in the GROUP BY clause or be used
> in an aggregate function
> SQL Status:42803
>
> regarts
> Thomas
>
>
>
> 2014-03-17 14:52 GMT+01:00 David Johnston <

> polobo@

> >:
>
>> Thomas Drebert wrote
>> > SELECT
>> > foo.updatezeit
>> > FROM
>>
>> You joined them ok.  But this says you only want to see the
>> foo.updatezeit
>> in the final output.  Try *
>>
>> David J.
>
>>

Sorry, "*" won't work because of the group/order at that level of the query.

You will need to devise a combination of select-list columns and group-by
columns that will give you the results you are looking for.

If you actually tell us what you want you will likely get better answers.
To be honest I'm not sure why you even have GROUP BY 1 in the query in the
first place.  Remove that and the "*" will work.

David J.





--
View this message in context: http://postgresql.1045698.n5.nabble.com/joining-2-Tables-tp5796290p5796463.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.


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

Предыдущее
От: Thomas Drebert
Дата:
Сообщение: Re: joining 2 Tables.
Следующее
От: Michael Rowan
Дата:
Сообщение: Postgres 9.1 trigger function parameters