Re: Ambiguous columns

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Tucknott <steve(at)retsol(dot)co(dot)uk>
Cc: PostGreSQL <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Ambiguous columns
Date: 2005-07-03 16:07:21
Message-ID: 4673.1120406841@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Steve Tucknott <steve(at)retsol(dot)co(dot)uk> writes:
> If I have two tables(taba, tabb) with the same column (column1) name and
> try to do:

> SELECT taba.column1 AS column1,tabb.column2 AS column2
> FROM taba AS a
> JOIN tabb AS b
> ON taba.indexCol = tabb.indexCol
> GROUP BY column1

> It tells me that column1 is ambiguous. Is that to be expected?

Yes.

> I thought you could only only group on selected fields,

No, that's never been true. You're confusing it with ORDER BY,
which has different rules.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2005-07-04 06:12:45 Re: Ambiguous columns
Previous Message Andreas Kretschmer 2005-07-03 08:42:19 Re: [despammed] Ambiguous columns