Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id B9CB72E0035 for ; Tue, 8 Apr 2008 14:14:37 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 43828-04 for ; Tue, 8 Apr 2008 14:14:28 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by developer.postgresql.org (Postfix) with ESMTP id 472772E0033 for ; Tue, 8 Apr 2008 14:14:30 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id j3so736355ugf.49 for ; Tue, 08 Apr 2008 10:14:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:content-type:content-transfer-encoding; bh=Ixs4jQZyPIxIpIq3TrqVoH0j0O8iFZadGwubmu9q0Wo=; b=Dq10YEfpnFqRzp1tZbgw9HtEQtrPb8FCddjehKDGIh2bGevYVpIXVhQZhGFLFjLkv2/hlvjcWfiXhsb1IQyvZgdDAU+pp56P2QwDyUSHboOORtH6zsZ39rXR/TD0qyvdQBozAn3VuKnrhp1RNr9uDSZmxYnNsFiiU3BgoMoQmbQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:content-type:content-transfer-encoding; b=exFMI0vzDkYLWPaYwjekvm9vWOPqsR58GWXDeDwHUWbsfzkNBABh2czCDSk0Y1ekg0NOg+03MO4HsiiJpeeT6DzGxrBiJZFCyZ8FdR3TMnmjUzWjjgI5zfFYeCqVtaV/pU0eUVBIUiPg8S37hHAxP4tLpGntH8FvoJb5igWEz7s= Received: by 10.78.204.1 with SMTP id b1mr688915hug.100.1207674867676; Tue, 08 Apr 2008 10:14:27 -0700 (PDT) Received: from ?192.168.1.5? ( [87.222.7.173]) by mx.google.com with ESMTPS id 39sm10986609hui.5.2008.04.08.10.14.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 08 Apr 2008 10:14:26 -0700 (PDT) Message-ID: <47FBA7F0.3000300@gmail.com> Date: Tue, 08 Apr 2008 19:14:24 +0200 From: Tk421 User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Pattern Matchig Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200804/51 X-Sequence-Number: 30590 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