Join issues
am 21.04.2010 16:51:11 von Weydson Lima
--000e0ce0d48865c3c20484c05468
Content-Type: text/plain; charset=ISO-8859-1
I am dealing with a JOIN error issue. The following query:
SELECT *
FROM (((ts_software RIGHT JOIN t_computers ON
t_softwareassoc.SoftwareAssocSoftwareID = ts_software.SoftwareID) LEFT JOIN
ts_softwaremfg ON
ts_software.SoftwareMfgID = ts_softwaremfg.SoftwareMfgID) LEFT JOIN
ts_eqtype ON
t_computers.CompEqTypeID = ts_eqtype.EqTypeID) RIGHT JOIN t_softwareassoc ON
t_computers.CompID = t_softwareassoc.SoftwareAssocCompID
is giving the error:
C_ReportUnknown column 't_softwareassoc.SoftwareAssocSoftwareID' in 'on
clause'
I assume that the reason for that error is because the first join is being
called before the RIGHT JOIN t_softwareassoc. What would be the best way to
solve that? I tried to move the RIGHT JOIN t_softwareassoc to the top but it
didn't help.
Thank you,
Wey
--000e0ce0d48865c3c20484c05468--
RE: Join issues
am 21.04.2010 17:34:07 von Lin Yu
It looks like that your first join clause are inconsistent in itself, that
is, you declared it for tables A & B, but actually used A & C instead:
ts_software RIGHT JOIN t_computers ON
t_softwareassoc.SoftwareAssocSoftwareID = ts_software.SoftwareID
-----Original Message-----
From: Weydson Lima [mailto:weyseal@gmail.com]
Sent: Wednesday, April 21, 2010 10:51 AM
To: mysql@lists.mysql.com
Subject: Join issues
I am dealing with a JOIN error issue. The following query:
SELECT *
FROM (((ts_software RIGHT JOIN t_computers ON
t_softwareassoc.SoftwareAssocSoftwareID = ts_software.SoftwareID) LEFT JOIN
ts_softwaremfg ON
ts_software.SoftwareMfgID = ts_softwaremfg.SoftwareMfgID) LEFT JOIN
ts_eqtype ON
t_computers.CompEqTypeID = ts_eqtype.EqTypeID) RIGHT JOIN t_softwareassoc ON
t_computers.CompID = t_softwareassoc.SoftwareAssocCompID
is giving the error:
C_ReportUnknown column 't_softwareassoc.SoftwareAssocSoftwareID' in 'on
clause'
I assume that the reason for that error is because the first join is being
called before the RIGHT JOIN t_softwareassoc. What would be the best way to
solve that? I tried to move the RIGHT JOIN t_softwareassoc to the top but it
didn't help.
Thank you,
Wey
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org