On Thu, 20 Jul 2006 15:44:32 +1000, you wrote:

>HI, all
>
>The following 2 queries (have the same result) are about to find some groups 
>which have some sort of missing transactions. Please advise which one would 
>have better performance. Thank you in advance!

Why not measure both cases with:
        time sqlite yourdatabase <yoursqlscript

>SELECT docketno
>FROM  cntt_sales2
>GROUP BY docketno
>HAVING MAX(CASE WHEN datacmd = 'RCP' THEN 1 ELSE 0 END) = 0
>ORDER BY docketno
>
>
>SELECT docketno FROM
>(SELECT docketno, MAX(case when datacmd = 'RCP' then 1 else 0 end)AS opendoc 
>FROM cntt_sales2 GROUP BY docketno)
>WHERE opendoc = 0

What is the table structure?

>Jack
-- 
  (  Kees Nuyt
  )
c[_]

Reply via email to