Alias query problem in 4.1.7?
am 23.11.2004 06:11:03 von thompsgr------=_NextPart_000_0070_01C4D0E8.8D31D5A0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
I have an interesting problem that I cannot find any clues to in the =
MySQL
documentation. The following query works in 3.2.3, but does not work in
4.1.7:
=20
SELECT `Product`.`Product`, `AssignedToAgent`.`AgentName` AS =
`AssignedTo`,
sum(`Inquiries`) AS `Inquiries` FROM `Inquiry` INNER JOIN `Product` ON
`Inquiry`.`ProductKey` =3D `Product`.`ProductKey` INNER JOIN `Agent` AS
`AssignedToAgent` ON `Inquiry`.`AssignedToKey` =3D
`AssignedToAgent`.`AgentKey` INNER JOIN `DateDim` AS `DateOpen` ON
`Inquiry`.`DateOpenKey` =3D `DateOpen`.`DateDimKey` WHERE =
`DateOpen`.`Year` =3D
'2003' GROUP BY `Product`.`Product`, `AssignedToAgent`.`AssignedTo`;
=20
It appears that if I take the table alias "AssignedToAgent" out of the =
GROUP
BY clause (leaving just the column alias "AssignedTo"), the query will =
then
work in 4.1.7 - even though the table alias does not present a problem =
in
3.2.3. Any ideas why?
=20
Any help would be greatly appreciated.
=20
Geoff Thompson
Avaion Support
support@avaion.com
http://www.avaion.com
=20
------=_NextPart_000_0070_01C4D0E8.8D31D5A0--