MySQL Forums
Forum List  »  Newbie

REGEX (search for x OR y -- where both are integers)
Posted by: Paul Smith
Date: August 01, 2005 06:56PM

Greetings. The problem I have dates back to my sorting Japanese strings problem... which can't really be solved w/ the version/setup of MySQL I'm using. The good side is that PHP can. The solution is to grab all the data that is returned, and have PHP sort it by the Japanese column. After it's sorted, I need to send another query, asking for all the information of the sequence of records I've sorted.

If I'm searching for strings, I'd do something like:
SELECT * FROM table WHERE title REGEXP 'this|that|him|her|them'
...or something along those lines. Since those strings can get rather large, I was hoping to search for it by record ID (integer). If I run:
SELECT * FROM table WHERE title REGEXP '50|233|1200|234|632'
it seems that it'll match any records with those numbers in them.
50,500,5000
233,2331,2332, etc.

Anyway to have a regular expression only return records where the ID equals (not contains) the value in the regex?

Options: ReplyQuote


Subject
Written By
Posted
REGEX (search for x OR y -- where both are integers)
August 01, 2005 06:56PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.