Hi,

> Now  I need a query which will take the values from column
> 'query',  treat  them  as patterns for matching and return
> row(s)  which  match  the given string 'blahblah'. In this
> example,  the  matched  data  is  obviously in second row.
> (bla% matches blahblah)

> Do I make any sense? Is this possible?
> Any help will be greatly appreciated.

To  be  honest I didn't belive it would work, but... here it
is :)

mysql> select * from blah;
+------+----------+-------+
| uid  | username | query |
+------+----------+-------+
|    1 | someuser | %qu1% |
|    2 | anotheru | bla%  |
+------+----------+-------+
2 rows in set (0.00 sec)

mysql> select * from blah where 'blahblah' like query;
+------+----------+-------+
| uid  | username | query |
+------+----------+-------+
|    2 | anotheru | bla%  |
+------+----------+-------+
1 row in set (0.00 sec)


Regards,
Sasa

ťmysql, select, databaseŤ



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to