MySQL Forums
Forum List  »  General

Re: Effective 1 to n linking
Posted by: Rick James
Date: June 14, 2009 01:22PM

Assuming both A and B have lots of data you are fetching, I would do it in two queries, not one:
* Select the row from A
* Select the row(s) from B

The first step might select all the rows from A, then loop thru them in your app code, fetching the row(s) from B.

Don't expect SQL to do everything for you; strike the right balance between what it can do well, and what your app language can do well.

Options: ReplyQuote


Subject
Written By
Posted
June 13, 2009 05:33AM
Re: Effective 1 to n linking
June 14, 2009 01:22PM


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.