Frage im Vorstellungsgespräch bei LTM Limited

Difference between join and union.

Antwort im Vorstellungsgespräch

Anonym

28. Mai 2025

Join - Horizontal combination - sticking tables together side-by-side union - Vertical Combination - stacking tables on top of each other. SELECT Customers.CustomerID, Customers.CustomerName, Orders.OrderID, Orders.OrderDate FROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID; SELECT EmployeeID, FirstName, LastName FROM Employees WHERE Department = 'Sales' UNION SELECT EmployeeID, FirstName, LastName FROM Employees WHERE Department = 'Marketing';