Can an ON clause of an INNER JOIN accept an AND?
In the following (and presently working) mysql example:
SELECT p.pk_ProductID
FROM Product p
INNER JOIN SerialNumber sn
ON sn.fk_ProductID = p.pk_ProductID
WHERE sn.pk_SerialNumberID = %s AND p.ProductGUID = %s
LIMIT 1
Is it legit to add an OR clause with sn.fk_ProductID2 like so:
ON sn.fk_ProductID = p.pk_ProductID OR sn.fk_ProductID2 = p.pk_ProductID
If legit, would it be stylistically more readable to be in parenthesis:
ON (sn.fk_ProductID = p.pk_ProductID) OR (sn.fk_ProductID2 = p.pk_ProductID)
NOTE: I have reviewed several seemingly similar questions on SO which contained conflicting advice re part 1 of my question.