David T. Ashley wrote:

Hi,

I have several tables linked in various ways so that an inner join is
possible.  However, at the same time and in the same SQL query, I'd also
like to query by some field values in one of the tables.

Two quick questions:

a)Will MySQL allow joins that involve more than two tables (in my case,
perhaps as many as 5)?

Yes. The join limit is 128 tables but if you hit it you've just done it wrong.

b)Can limits on a key field be included in the join in the same SQL
statement as does the join, i.e. ... WHERE N>3 AND N<20 ... or something
like that.

Yes. Though not everyone considers it good practice. As an example:

SELECT p.name, c.name
FROM parent p
INNER JOIN child c ON c.parent_id=p.id AND c.age < 18
WHERE  p.sex in ('male','unspecified');

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to