Hi ,
   I solve this problem using the following query..
 SELECT DISTINCT substring( url, locate( '?', url ) +1, 4 ) Country FROM 
urlinfo WHERE url LIKE '%?c=%';
    Thank you.....

cdg1111us <[EMAIL PROTECTED]> wrote:                                  You learn 
something everyday....  See for more info:
 http://dev.mysql.com/doc/refman/5.0/en/regexp.html
 
 If you're not familiar with them, regular expressions are used in
 several languages and are used to match specific patterns in text.
 
 Keep in mind that if you are loading the data from another database,
 it may be better for you to do the regular expression matching on the
 data as you load it, and insert that data into another column in your
 database.  I'm sure queries with regular expressions are slower and if
 you do lots of queries on lots of data, you'll want to put that data
 in the database so you can query it without regular expressions.
 
 --- In [email protected], James Keeline <[EMAIL PROTECTED]> wrote:
 >
 > --- Rajesh Kumar <[EMAIL PROTECTED]> wrote:
 > 
 > > Arun karthikeyan wrote:
 > > 
 > > > Hi thank you ......
 > > >    My database is retrieve from another automation tool.
 > > >  My question is ..
 > > >  Every link field should have 1 c='some value'
 > > >  I want to get that value...
 > > >  But i dont kno the position of c=.
 > > >  That field having only one 'c='
 > > >  Can you give me a query....
 > > 
 > > There's no query you can do for that. You will have to retrieve the 
 > > entire link and run a preg_match() on that using PHP:
 > > 
 > > $result = mysql_query('SELECT link FROM table_name');
 > > 
 > > while ($row = mysql_fetch_assoc($result)) {
 > > 
 > >    $cvalue = preg_match('/c=../', $row['link']);
 > >    $cvalue = $cvalue[0];
 > > 
 > > }
 > > 
 > > --
 > > Rajesh
 > 
 > There is the RLIKE clause which is similar to LIKE but uses regular
 > expressions.  I'm not sure if it could be used but it could be
 interesting.
 > 
 > James Keeline
 >
 
 
     
                       


               
    
   
  -With love
  SM.ARUNKARTIKAYAN
  








 
---------------------------------
Have a burning question? Go to Yahoo! Answers and get answers from real people 
who know.

[Non-text portions of this message have been removed]

Reply via email to