1
What’s the difference between JOIN and UNION in SQL? I thought a query made with either of the two would result in the same table, but I’m taking a course at Datacamp where the teacher says these two clauses don’t do exactly the same thing.
As the Joins are explained using the Venn diagram, I thought that for example a FULL JOIN would do the same as the clause UNION or even the clasp INETERSECT would do the same as the clause INNER JOIN.
There is even a difference in the results of a query using one or the other?
The result of a
JOINis one line containing the selected fields of the tables involved. The result of aUNIONis a ensemble lines each coming from one of the tables involved.– anonimo