[thelist] SQL multiple Joins?

r937 rudy at r937.com
Thu Nov 15 13:53:23 CST 2007

tris, one thing you might do is learn the differences between the
different types of joins

"X right join Y" means you want all Ys, with or without any matching Xs

so when you have this --

  FROM `users`RIGHT JOIN `activities` as `activitiesSep`
      on activitiesSep.UserID = users.ID

this suggests that you want all activities with or without the matching user

this doesn't make sense

how can you have an activity for a user that doesn't exist?

most likely you want INNER JOIN


More information about the thelist mailing list