Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 2 of 2 total |
SQL Question |
Wed, Aug 16 2006 12:37 PM | Permanent Link |
"David Ray" | I don't know if this is even possible, but here goes.
I have a name/address list which I'm running SQL against to pull a mailing list; it contains 1.5 Million records. I have been given a table containing a list of about 500 street & city names which are to be excluded. So, I have this SQL: SELECT * FROM T WHERE ("CODE" = "R") I need to modify this so that if the street field contains one of the excluded streets within a given city, the record is NOT selected. The problem is that the street field also contains a street number, like 1234 Main Street, in Dallas, TX. Any suggestions? TIA David |
Thu, Aug 17 2006 11:51 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | David,
<< I need to modify this so that if the street field contains one of the excluded streets within a given city, the record is NOT selected. The problem is that the street field also contains a street number, like 1234 Main Street, in Dallas, TX. >> The parsing of the street name may need a custom function in order to work in a robust fashion. However the rest is easy: SELECT T.* FROM T INNER JOIN EXCLUDE E ON T.CITY=E.CITY AND GETSTREETNAME(T.STREET) <> GETSTREETNAME(E.STREET) WHERE ("CODE" = "R") An index on CITY in the T table will go a long way towards making this query much faster, of course. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |