RE: SQL Syntax
| От | Jackson, DeJuan |
|---|---|
| Тема | RE: SQL Syntax |
| Дата | |
| Msg-id | F10BB1FAF801D111829B0060971D839F653517@cpsmail обсуждение исходный текст |
| Список | 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 по дате отправления: