From: Peter Brawley Date: December 14 2009 4:37pm Subject: Re: Join Statement List-Archive: http://lists.mysql.com/mysql/219731 Message-Id: <4B2669DA.209@earthlink.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------040609050200010403070705" --------------040609050200010403070705 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > ... on t.ProdID-p.ID; Your join clause subtracts the two IDs, so it's on IDs that differ, and apparently there aren't any. PB ----- Victor Subervi wrote: > Hi; > I have the following: > > mysql> select SKU, Quantity, Name, Price, p.sizes, > p.colorsShadesNumbersShort from tem126080739853 t join products p on > t.ProdID-p.ID; > Empty set (0.00 sec) > > mysql> select * from tem126080739853; > +----+--------+----------+-------------+--------------------------+ > | ID | ProdID | Quantity | sizes | colorsShadesNumbersShort | > +----+--------+----------+-------------+--------------------------+ > | 1 | 2 | 2 | Extra-small | navy-blue:CC7722 | > +----+--------+----------+-------------+--------------------------+ > 1 row in set (0.00 sec) > mysql> select SKU, Quantity, Name, Price, p.sizes, > p.colorsShadesNumbersShort from tem126080739853 t join products p on > t.ProdID-p.ID; > Empty set (0.03 sec) > > mysql> select SKU, Quantity, Name, Price, t.sizes, > t.colorsShadesNumbersShort from tem126080739853 t join products p on > t.ProdID-p.ID; > Empty set (0.00 sec) > > mysql> select ID, SKU, Name, Price from products; > +----+----------+-------+--------+ > | ID | SKU | Name | Price | > +----+----------+-------+--------+ > | 2 | prodSKU1 | name1 | 555.22 | > +----+----------+-------+--------+ > 1 row in set (0.00 sec) > > So I'm at a loss as to why the above select join statement fails. Please > advise. > TIA, > Victor > > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.427 / Virus Database: 270.14.107/2564 - Release Date: 12/14/09 07:37:00 > > --------------040609050200010403070705--