Thanks, Jocelyn. That's what I was looking for.

Jocelyn Fournier wrote:
Hi,

SELECT products.sku, products.title, products.price,
qty_price.qty, qty_price.qprice
FROM products LEFT JOIN qty_price ON (products.sku = qty_price.qsku) WHERE products.vendor_id=15 AND products.category='widgets';

should do what you want.

Regards,
  Jocelyn Fournier
  www.mesdiscussions.net


boll a écrit :
This query will display from the 'products' and 'qty_price' tables when the 'products.sku' and 'qty_price.qsku' fields match:

SELECT products.sku, products.title, products.price,
qty_price.qty, qty_price.qprice
FROM products, qty_price WHERE products.sku = qty_price.qsku
AND products.vendor_id=15 AND prod_test.category='widgets';

I would like to change it so that it will display the fields from 'products'
even if there is no corresponding row in the 'qty_price' table.

Thanks in advance for your suggestions.
J.





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to