I need to make a query on one table in a MYSQL database. In this query I need to make multiple selects with different where's.
My current query is:
$result = mysql_query("
SELECT
last_name, first_name, user_name,
SUM(rthours) as rthours, SUM(othours) as others,
SUM(trthours) as trthours, SUM(tothours) as tot hours
FROM data
WHERE labor_date BETWEEN '$start' AND '$end'
ORDER BY last_name ASC
");
I also need to select the following two:
SUM(rthours) as vhours FROM data WHERE decription = 'vacation' AND labor_date BETWEEN '$start' AND '$end'
and
SUM(rthours) as shours FROM data WHERE decription = 'sick' AND labor_date BETWEEN '$start' AND '$end'
How can I combine all three selects into one query so that I can then use them in a table that I am outputting afterwards.
Thanks for any help!