lists.zerezo.com



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

***BOGO*** Re: Trouble with alias



----- Original Message ----- 
From: ddevaudreuil@xxxxxxxxxxxxxxx 
To: mdimartino@xxxxxxxxxxxxxxxxx 
Cc: "mysql list" <mysql@xxxxxxxxxxxxxxx> 
Sent: Tuesday, May 27, 2008 9:18:47 AM GMT -08:00 US/Canada Pacific 
Subject: Re: Trouble with alias 


mdimartino@xxxxxxxxxxxxxxxxx wrote on 05/27/2008 01:31:16 PM: 

> 
> I having some issues setting aliases om my query. The details are as follows 
> 
> Table-Name = xcircuits 
> xcircuitsID (pimary key) 
> circuit 
> popA (secondary key refers to pirmary key on xpops table) 
> popZ (secondary key refers to pirmary key on xpops table) 
> 
> Table-Name = xpops 
> xpopID 
> pops 
> 
> 
> Query 
> SELECT l1.POPS AS`popA` , l2.POPS AS `popZ` 
> FROM xcircuits 
> INNER JOIN xpops.POPS AS l1 
> ON xcircuits.popA = l1.popID 
> INNER JOIN xpops.POPS AS l2 
> ON xcircuits.popA = l2.popID 
> LIMIT 0 , 30 
> 
> Error: Table xpops.pops doesn't exits 
> 

Your inner join statments need to join to a table, not a column. Try this: 
SELECT l1.POPS AS `popA` , l2.POPS AS `popZ` 
FROM xcircuits 
INNER JOIN xpops AS l1 ON xcircuits.popA = l1.popID 
INNER JOIN xpops AS l2 ON xcircuits.popA = l2.popID 
LIMIT 0 , 30 


Donna 


that was it. thank so much!