MySQL Forums
Forum List  »  Knowledge Base

What would be the best query
Posted by: Peter Fedeux
Date: October 20, 2009 02:26PM

To check whether the box_id "2" has ANY records, that have ANY records with the same box_val as box_id "1"

Using only one query, rather than looping through all records where box_id = 2 then checking for match



box_id | box_val
________________________
1 | 25
1 | 74
1 | 54
2 | 25
2 | 35



Thanks!

Options: ReplyQuote


Subject
Views
Written By
Posted
What would be the best query
2595
October 20, 2009 02:26PM
1676
October 21, 2009 11:28AM
1621
October 28, 2009 06:07AM


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.