Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Using WHERE with wildcard specifications and LIKE
Given the following records in XXX (there is a tag cGroup1+cGroup2+...), I
am trying to select the records where cGroup1==AJ (not including AJA) regardless of whether there is anything in cGroup2
cGroup1 C(3) cGroup2 C(3)
AB
AJ
AJ
AJ AA
AJ AB
AJA
AK
SELECT * FROM xxx WHERE cGroup1+cGroup2 LIKE 'AJ % '
(where there is a space between J and %)
returns the records where cGroup2 is not blank
SELECT * FROM xxx WHERE cGroup1 LIKE 'AJ ' and cGroup2 like '% '
returns records where cGroup1==AJ
What is the difference between the 2 select commands? I assume the 2nd
command will not use Rushmore, since the WHERE is not the exact key.
I would appreciate any help or suggestions.
Thanks,
Pessy Butler
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement