Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBAJhjm03588 for ; Mon, 10 Dec 2001 14:43:45 -0500 (EST) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.7) with HTTP id 524765; Mon, 10 Dec 2001 11:43:43 -0800 From: "Josh Berkus" Subject: Re: Replacing "LIKE" with "=" To: sharmad@goatelecom.com, pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.7 Date: Mon, 10 Dec 2001 11:43:43 -0800 Message-ID: In-Reply-To: <3c10405a.6b0.0@punweb01> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200112/110 X-Sequence-Number: 5933 Sharmad, > Can I replace a query statement having a "LIKE" with a statement > having "=" > still getting the same functionality > > Like for ex:- > SELECT * from teble_name WHERE name LIKE "%name%"; You cannot. WIthin the SQL standard, you must use "LIKE" if you want to use wildcards. PostgreSQL also supports the Regular Expression operator "~" which does a different kind of pattern matching. See "Functions and Operators" in the online PostgreSQL documentation, or purchase a copy of "PostgreSQL: Introduction and Concepts". -Josh Berkus ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco