Two syntaxes, same output... wondering if one is better in any way other than readability.
Simple case of two tables representing the weak entity and one of the entities of a many to many relationship. We'll pretend it's a list of keywords.
If I'm remembering my DB classes right, the two should be executed very similarly, both are basically going to do a full cross join, then elemented what doesn't match, right?
Eh, those classes is starting to get a little fuzzy, and of course it wasn't MySQL specific, so if you folks could help me out with this one I'd be appreciative.
-Rob
Simple case of two tables representing the weak entity and one of the entities of a many to many relationship. We'll pretend it's a list of keywords.
Code:
SELECT word
FROM file_has_words JOIN words
ON (file_has_words.word_id = words.word_id)
WHERE file_has_words.file_id=<some variable>
or I can just do
SELECT word
FROM file_has_words, words
WHERE file_has_words.file_id=<some variable>
AND file_has_words.word_id = words.word_id
If I'm remembering my DB classes right, the two should be executed very similarly, both are basically going to do a full cross join, then elemented what doesn't match, right?
Eh, those classes is starting to get a little fuzzy, and of course it wasn't MySQL specific, so if you folks could help me out with this one I'd be appreciative.
-Rob