Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAmadou Diallo
5,373 PointsWhy don't we just use INNER JOIN instead of INTERSECT?
Why don't we just use INNER JOIN instead of INTERSECT since they do, I think, the same thing?
1 Answer
Steven Parker
231,236 PointsThey can have the same final result; but a JOIN
adds an additional source to a single query based on specific matching criteria, and INTERSECT
combines two complete queries (two SELECT
s) that return identical columns.
Ryan Hartigan
3,425 PointsRyan Hartigan
3,425 PointsWhat do you mean by an additional source to a single query?
Steven Parker
231,236 PointsSteven Parker
231,236 PointsI mean pulling data from the columns of two (or more) tables.