From: Victor Subervi Date: December 14 2009 4:44pm Subject: Re: Join Statement List-Archive: http://lists.mysql.com/mysql/219732 Message-Id: <4dc0cfea0912140844u6d1cc577v58c4b5e37aad0bc5@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=00163683425862f708047ab2fd69 --00163683425862f708047ab2fd69 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Dec 14, 2009 at 12:37 PM, Peter Brawley wrote: > > ... 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. > I beg to differ: 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) t.ProdID == 2 p.ID == 2 That's a match. So why does my select join fail? TIA, V --00163683425862f708047ab2fd69--