On Sat, 14 Nov 2009 21:45:09 +0100, Kees Nuyt
<[email protected]> wrote:

> [-- sql with errors snipped --]

Make that:

SELECT 'detail' AS Descr,
        CASE 
                WHEN <condition> THEN <calculation> 
                ELSE <calculation>   
        END AS CalcA
   FROM yourtable
UNION
SELECT 'total' AS Descr sum(
        CASE 
                WHEN <condition> THEN <calculation> 
                ELSE <calculation>   
        END
) AS CalcA
  FROM yourtable;

(untested)
-- 
  (  Kees Nuyt
  )
c[_]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to