I got this query in sqlite
select kvadrat, datum, count(distinct kontrola) as pocet
from b
group by kvadrat, datum
having pocet > 1
The problem was that pocet
was actually a column in table b and I didn't notice, and the having
clause was using the table column instead of the newly derived column specified in select clause.
So far so good, but sqlite should at least issue any warning, right?
PS: I am using sqlite using sqldf package in R (version 0.4-7.1). Package RSQLite 0.11.4. According to its description the SQLite engine should be version 3.7.17.
Aucun commentaire:
Enregistrer un commentaire