difference between where and nested queries
- by Chris H
I'm not able to figure out the difference between these queries. I'm pretty sure that the first one is an equi-join. I'm not sure how the second one ISN'T the same as the first.
The sub query in #2 selects all Ids from S, and then it returns all R's that also have those ID's, no?
SELECT R.cname
FROM R, S,
WHERE R.Id = S.Id
SELECT R.cname
FROM R
WHERE R.Id IN (SELECT S.Id FROM S)