I have run a SUM query to achieve the following 2 columns and rows:
sum1 | sum2
10 20
The query I ran was the following:
SELECT SUM(minutes) as "sum1", SUM(hoursWorked) AS "sum2"
FROM entries
JOIN employees on employeeID = employees.userID
WHERE YEARWEEK(dateCreated) = YEARWEEK(NOW())
ORDER BY employeeID;
I want to combine the values into one column, to get the following:
sums
10
20
A bit lost on how to start with this. Searching has resulting in Concat which obviously wont work.
Can anyone help suggest a method to do this, or the correct function I should be searching for?
EDIT: As suggestions below, I resolved this by doing the following:
SELECT SUM(minutes) as "sum1"
FROM entries
JOIN employees on employeeID = employees.userID
WHERE YEARWEEK(dateCreated) = YEARWEEK(NOW())
UNION
SELECT SUM(hoursWorked) AS "sum2"
FROM entries
JOIN employees on employeeID = employees.userID
WHERE YEARWEEK(dateCreated) = YEARWEEK(NOW())