Re: joining 2 Tables. - Mailing list pgsql-novice

From David Johnston
Subject Re: joining 2 Tables.
Date
Msg-id 1395095924101-5796463.post@n5.nabble.com
Whole thread Raw
In response to Re: joining 2 Tables.  (Thomas Drebert <drebert@web.de>)
List 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 by date:

Previous
From: Thomas Drebert
Date:
Subject: Re: joining 2 Tables.
Next
From: Michael Rowan
Date:
Subject: Postgres 9.1 trigger function parameters