mysql SELECT. , , .
What I would do is fill out my blog table with all possible dates (for a year, and then repeat the process)
create table blog (
thedate date not null,
thetext text null,
primary key (thedate));
execution of a cycle to create all date records for 2011 (using a program, for example $ mydate is the date you want to insert)
insert IGNORE into blog (thedate,thetext) values ($mydate, null);
(the IGNORE keyword does not generate an error (thedate is the primary key) if the date already exists).
Then you usually insert the values
insert into blog (thedate,thetext) values ($mydate, "newtext")
on duplicate key update thetext="newtext";
Finally, to select blank entries, you just need to
select thedate from blog where thetext is null;
source
share