-
Jun 29th, 2002, 12:43 AM
#1
Thread Starter
Hyperactive Member
Simple SQL Question
i'm sorry if this doesn't belong here but i figure this would be the best place since most servers use SQL in one way or another, so here goes....:
when i am using the LIKE operator and the * wildcat will it find matches where there is nothing for the letter?
for example:
LIKE "cat*" = "cat"?
or in otherwords is a null character a valid match for a wildcard?
"There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein
If you are programming in Java use www.NetBeans.org
-
Jun 29th, 2002, 10:08 AM
#2
Fanatic Member
what your search is asking for is that the first three letters be the same in any value it finds.
For example ('field LIKE "cat*"') if you had the following values in your database:
- cat
- category
- caterer
- current
- camera
- element
- concatinate
Your Query would return the following as each of those has their first three letters as "cat" which is all SQL is looking for since you added the wildcard to the end stating anything can follow those three letters:
- cat
- category
- caterer
If you had 'field LIKE "*cat*"' it would return 4 results:
- cat
- category
- caterer
- concatinate
-Matt
-
Jun 29th, 2002, 11:59 AM
#3
PowerPoster
In Access, * or ? used as wildcards
Most if not all other SQL servers will use % or _
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|