RE: SQL Syntax

From: "Jackson, DeJuan" <djackson(at)cpsgroup(dot)com>
To: khj(at)cs(dot)appstate(dot)edu
Cc: PGSQL SQL <pgsql-sql(at)postgresql(dot)org>
Subject: RE: SQL Syntax
Date: 1999-02-08 20:49:57
Message-ID: F10BB1FAF801D111829B0060971D839F653517@cpsmail
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)cs(dot)appstate(dot)edu
> -Computer Science Dept www.cs.appstate.edu/~khj
> -Appalachian State Univ
> -Boone, NC 28608 USA
>

Browse pgsql-sql by date

  From Date Subject
Next Message Gregory Holston 1999-02-08 21:53:50 HAVING
Previous Message Bryan White 1999-02-08 18:36:39 Re: [SQL] Functional Indexes