Re: Ambiguous columns
От | Steve Tucknott |
---|---|
Тема | Re: Ambiguous columns |
Дата | |
Msg-id | 1120458011.2776.13.camel@retsol1 обсуждение исходный текст |
Ответ на | Re: Ambiguous columns (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-novice |
Tom, That could have been the case. The original query had both GROUP and ORDER. I assumed (my mistake) that the error was being generated by the GROUP clause. Why should ORDER by object - isn't that the same - ie it can only order on the selected fields? On Sun, 2005-07-03 at 17:07, Tom Lane wrote: > Steve Tucknott <steve@retsol.co.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 > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match -- Regards, Steve Tucknott ReTSol Ltd DDI 01903 828769 MOBILE 07736715772 ___________________________________________________________ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
В списке pgsql-novice по дате отправления: