List:General Discussion« Previous MessageNext Message »
From:Jamie Tibbetts Date:June 16 2002 5:17pm
Subject:Re: Need help with a complex query
View as plain text  
> Try - and I mean *try* :-)
> 
> SELECT Customers.* FROM Customers, Subscriptions
> LEFT JOIN Orders ON (Orders.customerid=Customer.CustomerID)
> LEFT JOIN Ordered_Items ON (Ordered_Items.orderid=Orders.id &&
> (Ordered_Items.productid = '23'))
> WHERE Customers.id=Subscriptions.customerid
> AND Subscriptions.listid='2'
> AND Ordered_Items.orderid IS NULL
> AND Orders.customerid IS NULL
> AND NOT Customers.bad_email;

Well, MySQL has been chugging on this one for about 15 minutes now, and it's
still going. So I'm not sure if it is a problem with the query or the
optimization of my MySQL databases. There are 30,000+ records in the
Customers database, but the query should have finished by now, right?

Jamie

Jamie Tibbetts    .....    tibbetts@stripped
Epigroove         .....    http://www.epigroove.com/

Thread
Need help with a complex queryJamie Tibbetts16 Jun
  • RE: Need help with a complex queryPeter Normann16 Jun
    • Re: Need help with a complex queryJamie Tibbetts16 Jun
      • RE: Need help with a complex queryPeter Normann16 Jun
        • Re: Need help with a complex queryJamie Tibbetts17 Jun
          • RE: Need help with a complex queryPeter Normann17 Jun
          • RE: Need help with a complex queryPeter Normann17 Jun
    • Re: Need help with a complex queryJamie Tibbetts18 Jun
      • RE: Need help with a complex queryPeter Normann18 Jun