what is the differenece these two statements
Database
2
Posts
2
Posters
0
Views
1
Watching
-
what is the difference between SELECT group_name FROM groups,users_groups WHERE users_groups.user_id=x and groups.group_id=x VS SELECT group_name FROM groups INNER JOIN users_groups ON users_groups.user_id = groups.group_id
In the first statement you leave it up to the sql query parser to decide how to join the tables. In the second case you are telling the query parser how you want the two tables joined. With only two tables it may not be a big deal other then the first example is slopy. Once you start to have several tables you are trying to join to your tables may not join together they way you want them to. I would sugest always use the second method. It make your code clear as far as what you are trying to do. Hope that helps. Ben