RE: sql join help

2004-04-11 Thread Michael Collins
Thanks Matt. But, what I am attempting to do with (oi.orderId IS NULL) is to eliminate the orders that have at least one order item with products of product parents not equal to 2. What you show finds all orders that have orderitems that have a product parent greater than 2, however, if that or

RE: sql join help

2004-04-11 Thread Matt Chatterley
Hmm. SELECT o.* FROM orders o INNER JOIN orderitems oi ON o.orderid = oi.orderid INNER JOIN products p ON p.productid = oi.productid AND p.productparentid > 2 WHERE o.orderstatus =2 Not sure why you are checking for a NULL ordered in orderitems? That would suggest you get back only items

Re: sql join help?

2003-02-19 Thread KH Chiu
Multiple table update is only supported from 4.04 or above. If you are using 3.x, I think you should put the result into another table, delete MSI_List and rename the table to MSI_List. I would also very interested to know whether there exist a more elegant solution for 3.x. Best regards, > s

Re: SQL join help

2002-05-20 Thread Ray Zimmerman
I figured it out ... At 3:22 PM +0100 5/20/02, ds wrote: >On Mon, 2002-05-20 at 13:34, Ray Zimmerman wrote: >... > > For example, given the following data ... >> >> CREATE TABLE Object ( >> id int(11) NOT NULL auto_increment, >> PRIMARY KEY (id) >> ); >> >> INSERT INTO O

Re: SQL join help

2002-05-20 Thread ds
On Mon, 2002-05-20 at 13:34, Ray Zimmerman wrote: ... > For example, given the following data ... > >CREATE TABLE Object ( > id int(11) NOT NULL auto_increment, > PRIMARY KEY (id) >); > >INSERT INTO Object (id) VALUES (1); >INSERT INTO Object (id) VALUES (2); >INSE