MySQL Forums
Forum List  »  PHP

Re: Complex search - multiple fields and tables - need advice.
Posted by: laptop alias
Date: April 18, 2012 05:05AM

With the exception of employee locations (which, by virtue of being itself an OUTER JOIN, has no relevancy at all to the query) all your tables are joined using OUTER JOINs with WHERE conditions attached. This effectively makes them INNER JOINs. Is this what you want?

Also I don't understand this line:

($date_field BETWEEN '$date_from' AND '$date_to')

Finally, well done for providing CREATE TABLE statements. However, to help with performance issues we usually need to see the EXPLAIN for the relevant query as well:

Please provide the result of EXPLAIN SELECT...

Edited 2 time(s). Last edit at 04/18/2012 05:18AM by laptop alias.

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.