[ic] Re: Ebay Feed - MySQL Query Problem
Gert van der Spoel
ic at 3edge.com
Mon May 15 12:37:13 EDT 2006
Kevin Walsh writes:
> "Gert van der Spoel" <ic at 3edge.com> 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. :-)
Please anyone give me a chance to add another sub-select!! ;)
> 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)
I'm sure you meant p.date_added ... Oh wait you spoiled this one already by
telling ... toooo baaaaaad! :)
More information about the interchange-users
mailing list