Re: [sqlite] GROUP BY months and years using integer data

2013-12-22 Thread Keith Medcalf
>So that in all cases, "value" contains the value of stats.quantity when >the selected month shows up in the iteration loop, and Zero >when any other month shows up, so Summing the values (or indeed doing any >other kind of aggregate function on it) will only affect >stats.quantity values for the

Re: [sqlite] GROUP BY months and years using integer data

2013-12-22 Thread RSmith
On 2013/12/22 20:53, James K. Lowden wrote: Similarly any attribute can be Boolean if it is found to be an attribute of an object. Giuseppe is not Boolean, but he is human and likely male, so that: (Giuseppe = Human) is true or 1, and (Giuseppe = Female) is false or 0. For RDBMS and indeed

Re: [sqlite] GROUP BY months and years using integer data

2013-12-22 Thread RSmith
On 2013/12/22 09:55, Giuseppe Costanzi wrote: I don't know if I have understood well but the statment SUM(stats.quantity * (stats.which_month = 1)) SUM(stats.quantity * (stats.which_month = 2)) should be interpreted SUM stats.quantity IF stats.which_month = 1 is TRUE SUM stats.quantity IF

Re: [sqlite] GROUP BY months and years using integer data

2013-12-22 Thread James K. Lowden
On Sun, 22 Dec 2013 05:35:55 +0200 RSmith wrote: > Similarly any attribute can be Boolean if it is found to be an > attribute of an object. Giuseppe is not Boolean, but he is human and > likely male, so that: (Giuseppe = Human) is true or 1, and > (Giuseppe = Female) is false

Re: [sqlite] memcpy usage in SQLITE

2013-12-22 Thread Richard Hipp
On Sun, Dec 22, 2013 at 1:05 PM, jitendar kumar wrote: > > My concern is not only about the memcpy in sqlite3ExprAlloc(). > > Do any other memcpy() instance present in source code "safe" from condition > where memcpy() having src=NULL and length !=0. > Dunno. Probably

Re: [sqlite] memcpy usage in SQLITE

2013-12-22 Thread jitendar kumar
Dear Mr Richard, Thanks for the information. My concern is not only about the memcpy in sqlite3ExprAlloc(). Do any other memcpy() instance present in source code "safe" from condition where memcpy() having src=NULL and length !=0. Regards, Jitendar Kumar

Re: [sqlite] GROUP BY months and years using integer data

2013-12-22 Thread Luuk
On 22-12-2013 08:55, Giuseppe Costanzi wrote: I don't know if I have understood well but the statment SUM(stats.quantity * (stats.which_month = 1)) SUM(stats.quantity * (stats.which_month = 2)) should be interpreted SUM stats.quantity IF stats.which_month = 1 is TRUE The original