4 ms·
One advantage of using user_id on both the pk of users as well as the fk side is you can do: INNER JOIN comments USING (user_id) instead of: INNER JO
by ryeguy 10y ago
One advantage of using user_id on both the pk of users as well as the fk side is you can do:
INNER JOIN comments USING (user_id)
instead of:
INNER JOIN comments ON comments.user_id = user.user_id
- philliphaydon 10y agoWhich is fine if you are aware of the differences between the two. Since they act differently.
- ryeguy 10y agoI don't think so, what differences are there? Could this be a database specific thing? In PG it seems equivalent.
- philliphaydon 10y agoIn MySQL you can end up with different results.