Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Whole Word SQL Search Trouble
Message
De
24/10/1997 19:14:34
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00056125
Message ID:
00056643
Vues:
36
>I'm trying to do an SQL that searches for whole words only, using the >'%'... >myfield LIKE "% FORD%" OR >myfield LIKE "% FORD %" OR >myfield LIKE "%FORD "...which correctly gets > >FORD MOTORS >DIXON FORD >BIG FORD CO > >but also BUFORD TIRES and CITY OF FORDHAM, which I don't want. > >Any ideas on how to do this? Or a better technique? I've noticed recently that the underscore character doesn't take spaces into account, so
    myfield like "%FORD%" ;
    and not myfield like "%_FORD%" ;
    and not myfield like "%FORD_%"
will allow FORD in any way except as a part of a word (no characters before it, and no characters after). It works (tested). Should be better optimizable than checking for left and right edges of the field.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform