Re: WHERE problem - Mailing list pgsql-general

From Hans-Jürgen Schönig
Subject Re: WHERE problem
Date
Msg-id 3E52650B.30103@cybertec.at
Whole thread Raw
List pgsql-general
Erik wrote:

>Hi all,
>
>I need to select rows from a table with a condition. I did it like this:
>
>SELECT message, date, author FROM table WHERE author='$author'
>
>$author is a variable. Works fine. But what am I gonna do if I want to
>select those rows where $author also can be a part of author. For example,
>If the user fills in "bush" I want postgresql also to select "george bush".
>
>How would I do that?
>
>thanks,
>
>Erik
>
>-- http://hg.shuis.tudelft.nl --
>        RLU #300477
>
>
>
>

Use regular expressions with LIKE or POSIX syntax (see online
documentation for full syntax information).
It is pretty simple.


    Regards,

        Hans



--
*Cybertec Geschwinde u Schoenig*
Ludo-Hartmannplatz 1/14, A-1160 Vienna, Austria
Tel: +43/1/913 68 09; +43/664/233 90 75
www.postgresql.at <http://www.postgresql.at>, cluster.postgresql.at
<http://cluster.postgresql.at>, www.cybertec.at
<http://www.cybertec.at>, kernel.cybertec.at <http://kernel.cybertec.at>


pgsql-general by date:

Previous
From: Raphael Bauduin
Date:
Subject: pg and chroot (performance)
Next
From: "Cristian Custodio"
Date:
Subject: pgMonitor