Quantcast
Viewing all articles
Browse latest Browse all 2

Tuesday Tidbit – JOIN on multiple fields

I use this so rarely I have a hard time remembering the syntax; I always try to use a comma instead of AND. Which, of course, throws an error. Looks like this: SELECT [stuff] FROM table1 t1 JOIN table2 t2 ON (t1.field1 = t2.field1 AND t1.field2 = t2.field2); Filed under: tidbitsImage may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 2

Trending Articles