On Thu, Feb 18, 2016 at 10:19 PM, Richard Hipp <drh at sqlite.org> wrote:
> On 2/18/16, Stephan Beal <sgbeal at googlemail.com> wrote:
> >
> > Thanks again to all for the feedback and suggestions!
> >
>
> After your talk, can we publish your calendar CTE as another example
> in the SQLite documentation?
>
i would be humbled. No need to wait for the presentation (still no time
slot scheduled - might be 4-6 weeks). i'll shoot it off to you once i've
added some comments about what each part is for.
i got the last-line-truncated problem solved (missing a clause in a
group-by), so it currently looks like:
...
select str from strMonth sm
where sm.year=2016 and sm.monthNum in (1,2,3)
;
[stephan at host:~/tmp]$ sqlite3 < cal.sql
----------------------
Jan 2016
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
----------------------
Feb 2016
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29
----------------------
Mar 2016
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
NOW to try to mark the current day... no... i'll leave that as an exercise
for the attendees!
--
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf