Hi,
Just wondering about one of my queries....
I use '% %' for searching - Why do we use % here?
thanks
What does '%search%' do?
Moderator: General Moderators
- mhouldridge
- Forum Contributor
- Posts: 267
- Joined: Wed Jan 26, 2005 5:13 am
%'s are used namely in LIKE statements. the %something% means that you are searching for any string that mathes what is in between the %'s.
ie, if you were searching for anything that had hte word ID in it, like state_id, man_id, or cat_id_num, you could do :
or, you could just use %something
which would return ONLY the ones that match having the word "id" at the end of it. the above example would only return, state_id and man_id
last, you could throw it at the end to match anything after the string
which would return only man_id
ie, if you were searching for anything that had hte word ID in it, like state_id, man_id, or cat_id_num, you could do :
Code: Select all
LIKE %id%Code: Select all
LIKE %idlast, you could throw it at the end to match anything after the string
Code: Select all
LIKE man%- mhouldridge
- Forum Contributor
- Posts: 267
- Joined: Wed Jan 26, 2005 5:13 am