in reply to MySQL query question...

Yes, this is a trivial task in mySQL..

And no, you dont need any temporary table...

Here is a simple example (using my own data)

mysql> SELECT send_time, DAYNAME(send_time) AS Day -> FROM BillArchive -> WHERE send_time BETWEEN '2005-08-02' AND '2005-08-05' -> HAVING Day = 'Wednesday' -> LIMIT 10; +---------------------+-----------+ | send_time | Day | +---------------------+-----------+ | 2005-08-03 15:41:40 | Wednesday | | 2005-08-03 23:08:52 | Wednesday | | 2005-08-03 16:12:23 | Wednesday | | 2005-08-03 14:25:40 | Wednesday | | 2005-08-03 19:50:22 | Wednesday | | 2005-08-03 20:02:46 | Wednesday | | 2005-08-03 14:25:40 | Wednesday | | 2005-08-03 20:02:46 | Wednesday | | 2005-08-03 22:37:50 | Wednesday | | 2005-08-03 20:02:46 | Wednesday | +---------------------+-----------+ 10 rows in set (0.09 sec)
- Darren

Replies are listed 'Best First'.
Re^2: MySQL query question...
by Anonymous Monk on Aug 16, 2005 at 20:17 UTC
    You don't need a temporary table, but you do need a table that actually contains dates to select from. That's easy enough, but what I would really like to do is to select a list of dates from a table that doesn't exist. Similar to how you can SELECT 5+5 and get 10 without selecting from a table. I'd like to be able to say

    SELECT date WHERE date BETWEEN start_date AND end_date AND DAY(date)='Wednesday';