Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
7. Conditions for UNION


Okay, how does the magic work? How can we show two tables as one?

As you probably expect, both tables must have the same number of columns so that the results can be merged into one table. Makes sense, right? You should also remember that the respective columns must have the same kind of information: number or text.

For example, if one of your queries has a row of numbers (1, 2, 3) and the other of varchars ('first', 'second', 'third'), the trick won't work.


Check out for yourself that unmatched column types will result in an error. Click I'm done. Next exercise to continue.