I am pretty sure that the following selected only a few records from a large file (ASHPNBR = 'BN123456' ).
Then I changed a paren or something small and I cant get it to select only a few records - now it selects ALL values of ASHPNBR.
The sub-select works great and only selects a few records.
When I add the outer select, the entire file is selected (all ASHPNBR values).
How does EXISTS know which keys to join between the inner & outer query? Do I have to explicitly state the join? Or does "EXISTS" make assumption about which fields to join?
select * from miscchg A
(select ASHPNBR, ABLDNGD, AMSCHRG from MISCCHG
ASHPNBR = 'BN123456'
group by ASHPNBR,ABLDNGD, AMSCHRG )
This outbound email has been scanned for all viruses by the MessageLabs Skyscan service.
For more information please visit http://www.symanteccloud.com
This mailing list archive is Copyright 1997-2015 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact