Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Pattern Matchig
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 3399 of 3558
Post > Topic >>

Pattern Matchig

by vrobador@[EMAIL PROTECTED] (Tk421) Apr 8, 2008 at 07:14 PM

Hello everybody

    I'm trying to make a query in a table to find the records who 
contains a full word 'im looking for.

    Here is an example about i'm trying

    code      text
    1            foobar
    2            xxxx foobar
    3            xxxx foobar yyyyy
    4            foobar xxxx
    5            foobars
    6            foobar.
    7            xxxx foobar.

    What i want is to find foobar (records 1, 2, 3 and 4) but no foobars 
(record 5). If i try

       SELECT code FROM table WHERE text LIKE '%foobar%'

    The result is 1, 2, 3, 4, 5, 6, 7.  But if I try

       SELECT code FROM table WHERE text LIKE '% foobar %'

    The result is only record number 3. How can i search the entire 
FOOBAR word? The result wanted must be all, excepting 5.

    Thank you very much.

    PD: Sorry about my english

-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql




 3 Posts in Topic:
Pattern Matchig
vrobador@[EMAIL PROTECTED  2008-04-08 19:14:24 
Re: Pattern Matchig
alvherre@[EMAIL PROTECTED  2008-04-08 13:24:09 
Re: Pattern Matchig
vrobador@[EMAIL PROTECTED  2008-04-08 19:39:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Fri Jul 4 22:56:06 CDT 2008.