SQL guru needed

Started by Felipe Alvarez Harneckerover 25 years ago3 messagesgeneral
Jump to latest

Hi,

i wonder if it is possible to do something like

SELECT foo FROM bar WHERE foobar IN ( 'some_regular_expresion1',
'some_regular_expresion2', ... )

Cheers

--
______________________________________________________

Felipe Alvarez Harnecker. QlSoftware.

Tel. 09.874.60.17 e-mail: felipe.alvarez@qlsoft.cl

Potenciado por Debian GNU/Linux http://www.qlsoft.cl/
______________________________________________________

#2Anatoly K. Lasareff
tolik@aaanet.ru
In reply to: Felipe Alvarez Harnecker (#1)
Re: SQL guru needed

"FAH" == Felipe Alvarez Harnecker <felipe@qlsoft.cl> writes:

FAH> Hi,

FAH> i wonder if it is possible to do something like

FAH> SELECT foo FROM bar WHERE foobar IN ( 'some_regular_expresion1',
FAH> 'some_regular_expresion2', ... )

My mind: this is impossible in Postgres. Pehaps

SELECT foo FROM bar WHERE
foobar ~ 'some_regular_expresion1' or
foobar ~ 'some_regular_expresion2' or
foobar ~ 'some_regular_expresion3'

is your goal?

--
Anatoly K. Lasareff Email: tolik@aaanet.ru

#3Cesar A. K. Grossmann
cesar@rotnet.com.br
In reply to: Felipe Alvarez Harnecker (#1)
Re: SQL guru needed

Felipe Alvarez Harnecker wrote:

i wonder if it is possible to do something like

SELECT foo FROM bar WHERE foobar IN ( 'some_regular_expresion1',
'some_regular_expresion2', ... )

Well, I'm not exactly a SQL guru, but I hope it helps you:

SELECT foo FROM bar
WHERE
foobar LIKE 'some_regular_expression1' OR
foobar LIKE 'some_regular_expression2' OR
...

Read the User Guide you can find in http://www.PostgreSQL.org/ - regular
expressions in SQL are a little different from the traditional regular
expressions you can find in UNIX or DOS.

[]s
--
C�sar A. K. Grossmann ckant@usa.net http://members.xoom.com/ckant/
http://www.halcyon.com/sciclub/cgi-pvt/instr/instr.html