this report of clients who used a service but had zero charge INVOICE has 132000 distinct recs vw_use has 170000 distinct recs vw charge has 140000 distinct recs the views are projections for /country ALL THE UNDERLYING KEY FIELDS ARE INDEXED ON KEYS THE MYSQL QUERY, INSERT INTO REPORT() SELECT custnum,region,status,invoice,inv_date,price,discount FROM INVOICE i WHERE EXISTS(select * from vw_use u where i.custnum=u.custnum) AND NOT EXISTS (select * from vw_charge c where i.invoice=c.invoice) Bernard, Nicholas thanx so far... The optimist sees the doughnut; the pessimist the hole. --- On Fri, 5/22/09, bernard kioko <bernsoft@gmail.com> wrote:
|