Re: Query - multiple joins won't return any records
Posted by:
Rick James
Date: February 15, 2015 07:59PM
Sorry, I missed a point:
The FieldID defines the table (1=divisions; 2=teams)
Which means that FieldID does need to be in the ON, not the WHERE.
Anyway, it is not 'normal' to put all the many-to-many relationships in a single table (as Peter pointed out). Please split `Relations` into two (or more) tables, one for each N-N relation. And use consistent naming (DivisionID, not ValID) so that the JOINs are easy to validate. (This is for my sake as a helper, and I'll bet it will keep you out of trouble eventually.)
After that, please present the CREATE TABLEs and the SELECT, plus EXPLAIN SELECT...
Subject
Written By
Posted
February 13, 2015 09:32PM
February 14, 2015 10:21AM
February 14, 2015 10:57AM
February 14, 2015 03:03PM
February 15, 2015 01:40AM
February 15, 2015 09:59AM
February 15, 2015 01:40PM
February 15, 2015 02:33PM
February 15, 2015 02:54PM
February 15, 2015 03:09PM
Re: Query - multiple joins won't return any records
February 15, 2015 07:59PM
February 19, 2015 03:06PM
February 19, 2015 04:17PM
February 21, 2015 07:01PM
February 14, 2015 11:39PM