In SQL, can we always write an inner join statement as a main query and subquery if we only want to
Posted
by Jian Lin
on Stack Overflow
See other posts from Stack Overflow
or by Jian Lin
Published on 2010-04-25T10:29:24Z
Indexed on
2010/04/25
10:33 UTC
Read the original article
Hit count: 273
In SQL, can we always write an inner join statement as a main query and subquery or vice versa if we only want to find the intersection?
For example,
select * from gifts g where g.giftID in (select giftID from sentGifts);
can do a join and show the gifts sent in the sentGifts table, but it won't be able to show the sentTime because that is inside the subquery. But if all we care is to find the intersection, without caring what is being displayed, then we can always convert one to the other?
© Stack Overflow or respective owner