MySQL Forums
Forum List  »  Newbie

Re: how to optimize this query
Posted by: Minski Browar
Date: March 16, 2009 10:29PM

Please try this statement instead and let us know the change

SELECT f.id, f.species_name, f.date
FROM lister_importedsighting as f
WHERE user_id=%s
and NOT EXISTS ( SELECT x.id
FROM lister_importedsighting as x
WHERE f.user_id = x.user_id
and f.species_name = x.species_name
and f.date > x.date
)

Options: ReplyQuote


Subject
Written By
Posted
March 12, 2009 10:15PM
Re: how to optimize this query
March 16, 2009 10:29PM
June 12, 2009 06:25AM


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.