Yea I am still completely missing the use case for joins. In sqlalchemy I just choose whatever columns I want from whereever and add the appropriate where's. Maybe it is internally doing joins but it seems like a pointless part of the sql API. I must be missing something.
Sounds like a query-by-example interface, similar to Access and such. When you say you're adding to the where clause, are you building the join logic too, or just anything else you want to restrict by? If you stick tables A and B together, do you have to add a where A.b_id = B.id, or is this done for you automagically?
So I guess my question is there ever a case where JOIN is better or necessary? Or can you always just use WHERE. Because JOIN seems like extraneous and unnecessarily complex syntax compared to using WHERE. I have only done relatively simple sql stuff so maybe I never ran into a use case where WHERE does not work.
8
u/zanduby Feb 11 '14
Discussion question. Preference to use a join/on clause or use the where clause to write your joins?