On Nov 13, 2006, at 2:34 PM, Vince Teachout wrote:

> I often have the need to select all records from a file where 3 (to  
> make
> it easy) fields are the same as 3 fields in another file.  I do it  
> like so:
>
> Select * from fileA where store_no+slsper+division in (Select
> store_no+slsper+division from fileB)
>
> I KNOW that's not right, but what is the correct syntax?  Thanks.

SELECT * FROM FileA ;
        JOIN FileB ON FileA.store_no + FileA.slsper + FileA.division = ;
                 FileB.store_no + FileB.slsper + FileB.division

        There's nothing wrong with your syntax, although with large tables  
it may be a lot slower.


-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to