Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Soft seeking
Message
De
18/04/2006 14:31:26
 
 
À
18/04/2006 01:51:52
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
01114214
Message ID:
01114354
Vues:
15
This won't work if you're doing client-server, but it works in my VFP 6 environment
m.lcPhone = '817145779'
lcAnsi = SET("ANSI")
SET ANSI OFF
SELECT areacode,LEN(TRIM(areacode)) AS result_len FROM myTable;
  WHERE m.lcPhone = areacode;
  ORDER BY result_len DESC;
  TOP 1
SET ANSI &lcAnsi
>Dear All,
>
>I have records in 'Area' table, like below:
>
>AreaCode
>80
>801
>81
>817
>8171
>81715
>818
>82
>821
>
>What SQL command should I use if I want to soft search into AreaCode with value '817145779' and I want it returns '8171' (because '8171' is the most accurate pattern in the table)
>
>Please help
>
>Thanks a lot in advance
>
>Regards
>Winanjaya
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform