i want to make a select with a like
where i want the start of the string to be in the range of
01..09
means :
01dfgasfasdf321
02df465as4dfwer
and so on to...
09sd1231asdf
how do i do that?
thnaks in advance
peleg
help needed with "like" on sql syntax
Moderator: General Moderators
-
leenoble_uk
- Forum Contributor
- Posts: 108
- Joined: Fri May 03, 2002 10:33 am
- Location: Cheshire
- Contact:
You may have to use a REGEXP instead of LIKE.
To use a LIKE you'd have to do:
LIKE '01%' OR
LIKE '02%' OR
LIKE '03%' etc etc.
I haven't ever had to use REGEXP in an sql query so someone else may have to help with the exact syntax but it's probably something like
WHERE col_name REGEXP('^0[1-9][:alnum:]+$')
Check it out in the mysql manual.
To use a LIKE you'd have to do:
LIKE '01%' OR
LIKE '02%' OR
LIKE '03%' etc etc.
I haven't ever had to use REGEXP in an sql query so someone else may have to help with the exact syntax but it's probably something like
WHERE col_name REGEXP('^0[1-9][:alnum:]+$')
Check it out in the mysql manual.
-
leenoble_uk
- Forum Contributor
- Posts: 108
- Joined: Fri May 03, 2002 10:33 am
- Location: Cheshire
- Contact: