Mysql filling in missing dates

Posted by bsandrabr on Stack Overflow See other posts from Stack Overflow or by bsandrabr
Published on 2010-03-23T17:07:05Z Indexed on 2010/03/23 17:13 UTC
Read the original article Hit count: 159

Filed under:
|

I have the following query

SELECT * 
FROM attend
RIGHT OUTER JOIN noattend ON attend.date = noattend.date2
WHERE attend.date
BETWEEN '2010-02-01'
AND '2010-04-01'
AND attend.customerid =1
ORDER BY date DESC 
LIMIT 0 , 30

Attend is the table with customerid noattend is the table with a row for each date (date2) I followed the advice in other questions to right outer join it to create values where there is no record in attend but it still isn't filling in the empties any help much appreciated

© Stack Overflow or respective owner

Related posts about mysql

Related posts about join