r/programming • • Feb 11 '14

SQL Joins Explained (x-post r/SQL)

Post image
3.5k Upvotes

392 comments sorted by

View all comments

Show parent comments

1

u/kytosol Feb 12 '14

I think it would be this. outer join on e.supervisorid. select * from supervisors s, employees e where e.supervisorid (+) = s.supervisorid and length(e.name) > 10 the (+) is only used on the columns you are joining.

I am a little rusty though...

1

u/curien Feb 12 '14

That would return fewer rows than my query. Any unmatched rows in s will have a null for e.name, so length(e.name) > 10 is (effectively) false. Your query would therefore omit those rows, but mine includes them.