yeah districtno is text, unfortunately we have some districtno's that are "10306C" so we have it as a text 7.
in the locations table we have a bunch of locations for different districts but district '67959' might have locno '010' and district '10306C' might also have locno '010' so we are qualifying by districtno on both tables so 67959 users dont see the location description from 10306C (its happened in the past and it confused some people hehe). ----- Original Message ----- From: "Lawrence Lustig" <[EMAIL PROTECTED]> To: "RBASE-L Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, December 02, 2004 10:32 AM Subject: [RBASE-L] - Re: Propper SQL > > districtno and locno are in both tables and arent unique values in either > > one, would i still not have to limit by districtno in both tables? > > No, by saying "tranmaster.districtno = '67959'" you are limiting the result set > for tranmaster to only the few records that have the value specified. R:Base > will then attempt to take these (few) records, look at their LOCNO values and > find matches in the location table. Any locnos on the location side that were > excluded from the tranmaster side of the select will not be eligible for > inclusion in the final result set. > > By the way, is districtno INT or TEXT? If the contents of that field are > _really_ integer columns, you might get better performance redefining the > column. > -- > Larry >

