On 03/11/2013 11:55 AM, Harald Leithner wrote:

> SELECT
>  CASE
>   WHEN seen_flag+recent_flag = 0 THEN
>       0
>   WHEN seen_flag = 1 THEN
>     1
>   WHEN recent_flag = 1 THEN
>     2
>  END
>  AS flag, COUNT(*) FROM dbmail_messages WHERE mailbox_idnr=6 AND (status
> < 2) group by seen_flag, recent_flag;

This one at least works on all three main supported backends.


-- 
________________________________________________________________
Paul J Stevens        pjstevns @ gmail, twitter, skype, linkedin

  * Premium Hosting Services and Web Application Consultancy *

           www.nfg.nl/[email protected]/+31.85.877.99.97
________________________________________________________________
_______________________________________________
DBmail mailing list
[email protected]
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

Reply via email to