Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.oracle    |    Overblown overpriced overengineered SHIT    |    2,288 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 703 of 2,288    |
|    andy vandenberghe to boston103@hotmail.com    |
|    Re: Sql select question    |
|    21 Nov 03 18:23:06    |
   
   From: hp275_removethis@skynet.be_removethis   
      
   Hi VC,   
      
   Thanks, your code worked allright; here's the real-world translation.   
      
   /* list all accounts where the count is not equal */   
   select a.voucher_no, a.ext_inv_ref, a.count_700500, b.count_400   
   from (select voucher_no, ext_inv_ref, count(*) count_700500   
   from agltransact   
   where client='MG'   
   and account=700500   
   and voucher_type in('P4','P5')   
   and voucher_no >= 63000020   
   and voucher_no <= 63000024   
   group by voucher_no, ext_inv_ref) a,   
   (select voucher_no, ext_inv_ref, count(*) count_400   
   from agltransact   
   where client='MG'   
   and account in('400400','400500','400301','400300')   
   and voucher_type in('P4','P5')   
   and voucher_no >= 63000020   
   and voucher_no <= 63000023   
   group by voucher_no, ext_inv_ref) b   
   where a.ext_inv_ref = b.ext_inv_ref   
   and a.voucher_no=b.voucher_no   
   and a.count_700500 != b.count_400;   
      
   Hrgds,   
   andy   
      
   In article
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca