I want to bring a column from another table that matches my id from the current table.
I've done this query:
SELECT dept, SUM(quantity) as TotalQuantity
FROM sale
GROUP BY dept
ORDER BY TotalQuantity;
Which gives me a total of items sold of a specific "department", now I want to bring the name of the department in there WITHOUT and WITH using explicit join. The department name is in another table called "dept" with column "name". Is there also possible the get the null values of my "sale" table as well?
SELECT dept, SUM(quantity) as TotalQuantity
FROM sale
GROUP BY dept
ORDER BY TotalQuantity;