Still getting and error on the last line SELECT p1.POPS AS `POPA`, p2.POPS AS `POPZ` FROM circuits INNER JOIN pops.POPS as p1 WHERE circuits.popID_A =p1.popID INNER JOIN pops.POPS as p2 WHERE circuits.pop_ID_Z =p2.popID
Table-name = circuits circuitID popID_A (secondary key referencing pops.popID) pop_ID_Z (secondary key referencing pops.popID) table-name = pops popID pops ----- Original Message ----- From: "Rob Wultsch" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Cc: "MYSQL General List" <mysql@lists.mysql.com> Sent: Friday, May 23, 2008 9:25:38 AM GMT -08:00 US/Canada Pacific Subject: Re: Query Output Issue On Fri, May 23, 2008 at 12:04 PM, <[EMAIL PROTECTED]> wrote: > Thanks for the quick reply, however i am getting a failure on line 2. > > SELECT > 11.POPS AS `POPA`, > 12.POPS AS `POPZ` > FROM > circuits > INNER JOIN pops.POPS as 11 WHERE circuits.popA = 11.popID > INNER JOIN pops.POPS as 12 WHERE circuits.popZ = 12.popID > > Table-name = circuits > circuitID > popA (secondary key referencing pops.popID) > popZ (secondary key referencing pops.popID) > > > table-name = pops > popID > pops Don't alias as a number, or if you do quote escape it... Note I used l1 and l2 for table aliases, not 11 and 12. -- Rob Wultsch [EMAIL PROTECTED] wultsch (aim) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]