Re: Replacing "LIKE" with "=" - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Replacing "LIKE" with "="
Date
Msg-id web-524765@davinci.ethosmedia.com
Whole thread Raw
In response to Replacing "LIKE" with "="  (sharmad@goatelecom.com)
List pgsql-sql
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
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: Poolman/mySQL transaction exception on connect
Next
From: Stephan Szabo
Date:
Subject: Re: serial sequences not automatically dropped