[SOLVED] Using REGEXP on SELECT
Posted: Mon Nov 13, 2006 4:58 am
feyd | Please use
the idea is to select everithing from TABLE that contains a number not preceded by or followed by a number.
my "filed" contains a string linke this:
row_1 = 12|500|1|1254|9|2
row_2 = 5|312|4|5412|99|20
and so on
a nuber sequence divided by |.
I want to match the rows that match for example "12" nad just "12" not "312" or "120".
Anyone can help me with this?
TNX you in advance
Jaxolotl
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi everyone!
I'm trying to improve my MySQL knowledge using REGEXP on QUERIES, but I'm trying to make a query like this and I don't know how to implement the REGEXP
EXPL query
[syntax="sql"]
SELECT *
FROM `table`
WHERE `field` REGEXP 'my regexp'
my "filed" contains a string linke this:
row_1 = 12|500|1|1254|9|2
row_2 = 5|312|4|5412|99|20
and so on
a nuber sequence divided by |.
I want to match the rows that match for example "12" nad just "12" not "312" or "120".
Anyone can help me with this?
TNX you in advance
Jaxolotl
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]