Q:

How to Ensure Efficiency on Nested Select Query?

Mysql is not my strongest language! But I'm happy to have produced something that gives proper results which would otherwise involve three separate (php) queries. 
Yet I'm not certain this is ideal. Here is the query:
SELECT * FROM
(
    (SELECT sum(price) AS day FROM sales WHERE sold_date > DATE_SUB(NOW(), INTERVAL 1 DAY)) as day,
    (SELECT sum(price) AS week FROM sales WHERE sold_date > DATE_SUB(NOW(), INTERVAL 1 WEEK)) as week,
    (SELECT sum(price) AS month FROM sales WHERE sold_date > DATE_SUB(NOW(), INTERVAL 1 MONTH)) as month
)
WHERE 1

And it gives this beautiful result:
+--------+---------+----------+
| day    | week    | month    |
+--------+---------+----------+
| 356.00 | 2393.00 | 11026.00 |
+--------+---------+----------+

I couldn't be happier.
Yet with a large database, I'm concerned this query structure might be too much? 
How can I ensure this is not destined to be a resource hog? 

A:

Your query might be surprisingly efficient.  You can, however, try this with conditional aggregation:
select sum(case when sold_date > DATE_SUB(NOW(), INTERVAL 1 DAY) then price else 0 end) as "day",
       sum(case when sold_date > DATE_SUB(NOW(), INTERVAL 1 WEEK) then price else 0 end) as "week",
       sum(case when sold_date > DATE_SUB(NOW(), INTERVAL 1 MONTH) then price else 0 end) as "month"
from sales
where sold_date > DATE_SUB(NOW(), INTERVAL 1 MONTH);

Having an index on sales(sold_date) should help the query.  An index on sales(sold_date, price) should be even better.

