Some of my coworkers have been using sub-queries in places where you can simply use a join. pros and cons partially discussed in this SO post.
Most of their queries can be reduced down to the following pattern:
SELECT T1.a, (SELECT T2.b FROM T2 WHERE T2.a = T1.a )
FROM T1
which can be re-written as:
SELECT T1.a, T2.b
FROM T1
LEFT JOIN T2
ON T1.a = T2.a
Can some awesome SOer give me an example where sub-queries can be used to implement an algorithm that can't be re-written using joins?
back story: I find JOINs much easier to read and manage. sql queries written using sub-queries drive me (my subconscious) nuts! I'm trying to find a reason not to hate them so much!