I am using delphi to campare telephone numbers against a table of telephone number area codes. These arecodes can be upto ten digits, so using a for loop, I am comparing the the first ten digits of the number. If there are no matches I then will delete one digit from the right of the telephone number until there is a match with an area code. Is there any faster way I can compare these telephone numbers within sqlite?
rough code--------------------------------------------------- for ($i = 10); $i != 0; $i--) { $areacode = substr(0186532326, 0,$i); SELECT * FROM stdcodes WHERE areacode = '$areacode; if sql_results >1 THEN break; ELSE continue; --------------------------------------------