From: Jackson, DeJuan <djackson@cpsgroup.com>
To: khj@cs.appstate.edu
Cc: PGSQL SQL <pgsql-sql@postgresql.org>
Subject: RE: SQL Syntax
Date: Mon, 8 Feb 1999 14:49:57 -0600
Message-ID: <F10BB1FAF801D111829B0060971D839F653517@cpsmail> (raw)
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
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: djackson@cpsgroup.com, khj@cs.appstate.edu
Subject: RE: SQL Syntax
In-Reply-To: <F10BB1FAF801D111829B0060971D839F653517@cpsmail>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox