| From: | "Jaime Casanova" <systemguards(at)gmail(dot)com> |
|---|---|
| To: | "Gregorio Diaz" <gregorio_diaz(at)yahoo(dot)com>, pgsql-es-ayuda(at)postgresql(dot)org |
| Subject: | Re: LIKE multiple |
| Date: | 2006-09-15 03:11:34 |
| Message-ID: | c2d9e70e0609142011m5e5f4a0ate6f88c932862e87a@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-es-ayuda |
On 9/14/06, Alvaro Herrera <alvherre(at)commandprompt(dot)com> wrote:
> Gregorio Diaz escribió:
> > Hola lister(at)s
> >
> > Alguien sabe porque esto no funciona:
> >
> > SELECT nombre FROM personas WHERE nombre LIKE ('gr%',
> > 'al%', 'pe%')
>
> Porque no es legal segun SQL. Esto si:
>
> select * from personas where nombre any ~~ (array['gr%', 'al%', 'pe%']);
>
o
select * from personas where substring(nombre from 1 for 2) in ('gr',
'al', 'pe')
--
Atentamente,
Jaime Casanova
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andrea | 2006-09-15 11:08:30 | Re: Pasar tabla |
| Previous Message | Alvaro Herrera | 2006-09-15 02:43:14 | Re: LIKE multiple |