Kevin Walsh <suppressed> wrote: > "Gert van der Spoel" <suppressed> wrote: > > William Fiore writes: > > > You were right. I changed "CurrentDate()" to "CurrentDate() -90" and I am > > > getting some results. Do you have any idea how I can also only display > > > sku's that are located in the "sku" column of my "orderline" table. > > > > > Untested, no guarantees: > > > > SELECT * FROM products WHERE sku = ANY (SELECT sku FROM inventory > > WHERE quantity > 5) AND date_added >= curdate() AND sku = ANY (SELECT sku > > FROM orderline) > > > Sorry to jump in here, but I can't read any more sub-selects without > covering my monitor with diced carrot. :-) > > Try something like the following instead (untested): > > SELECT DISTINCT p.sku, p.title, p.description, p.price > FROM products p, inventory i, orderline o > WHERE p.sku = o.sku > AND p.sku = i.sku > AND i.quantity >= 5 > AND i.date_added >= DATE_ADD(CURDATE(),INTERVAL -90 DAY) > Before anyone notices, I should point out that the "i.date_added" might want to be be "p.date_added". -- _/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/ _/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h _/ _/ _/ _/ _/ _/ _/ _/_/ suppressed _/ _/ _/_/_/_/ _/ _/_/_/ _/ _/ _______________________________________________ interchange-users mailing list suppressed http://www.icdevgroup.org/mailman/listinfo/interchange-users
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.