RE: SQL Syntax - Mailing list pgsql-sql

From Jackson, DeJuan
Subject RE: SQL Syntax
Date
Msg-id F10BB1FAF801D111829B0060971D839F653517@cpsmail
Whole thread Raw
List pgsql-sql
The error that you are running into is it appears you believe that || is
an OR operator.  In Postgres (and I believe the SQL standard) the '||'
operator is used for string concatenation.
I believe the query you are seeking is:
   select title from book where title ~* 'world|nation'
    -DEJ;
> -----Original Message-----
> I am trying to use something like the following in 6.4.2:
>
>   select title from book where title ~* ('world' || 'nation');
>
> Though one of your emails to the 'postgresql' list uses something
> similar, the above returns no matches (even though some records
> contain both strings).
>
> Any ideas?
>
> I'm trying to find a shorter form than
>
>   select title from book where title ~* 'world' or title ~* 'nation';
>
>
> Thanks for any help,
>
> -Prof Kenneth H Jacker       khj@cs.appstate.edu
> -Computer Science Dept       www.cs.appstate.edu/~khj
> -Appalachian State Univ
> -Boone, NC  28608  USA
>

pgsql-sql by date:

Previous
From: "Bryan White"
Date:
Subject: Re: [SQL] Functional Indexes
Next
From: pierre@desertmoon.com
Date:
Subject: Quickie