https://bugs.kde.org/show_bug.cgi?id=351475
--- Comment #3 from Daniel Vrátil <dvra...@kde.org> --- Reconstructing queries from SQL builder is hard :-) This is the correct query: SELECT count(DISTINCT PimItemTable.id), sum(PimItemTable.size), sum(CASE WHEN PimItemFlagRelation.flag_id = $1 OR PimItemFlagRelation.flag_id = $2 THEN 1 ELSE 0 END) FROM PimItemTable LEFT JOIN PimItemFlagRelation ON PimItemTable.id = PimItemFlagRelation.pimitem_id WHERE PimItemTable.collectionId = $3 -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Kdepim-bugs mailing list Kdepim-bugs@kde.org https://mail.kde.org/mailman/listinfo/kdepim-bugs