Re: Exists Tupel Queries ?
Posted in 2000
Topics: SQL Development & Query Writing
Try someting like:
select id
from tab1
where a || "x" || b in ("2x3", "3x7", "5x10")
HTH
>>> Thorsten Geelhaar <thorsten.geelhaar@materna.de> 01/25/00 08:51am >>>
Hello
Can anybody tell if it possible to ask for tupel in a
select statement ?
An example:
Normaly : select id from tab1 where ( a=2 and b=3 ) or
( a=3 and b=7 ) or
( a=5 and b=10)
Wanted somthing like this:
select id from tab1 where (a,b) in ({2,3},{3,7},{5,10})
Also i was interested if the normaly case could be simplified.
THANX to ALL
Thorsten
------------------------------------------------------
Thorsten Geelhaar Telefon: +49 231 5599 106
Dr. Materna GmbH Fax : +49 231 5599 100
Vosskuhle 37 e-mail : Thorsten.Geelhaar@materna.de
D-44141 Dortmund GERMANY
------------------------------------------------------
Not exactly the same thing Richard since the concatenated query cannot use
any
indexes on a or b. The answer to Thorsten is: No, standard SQL does not
support
the kind of syntax you want to use.
Art S. Kagel
Richard harnden wrote:
> Try someting like:
>
> select id
> from tab1
> where a || "x" || b in ("2x3", "3x7", "5x10")>
> HTH
>
> >>> Thorsten Geelhaar <thorsten.geelhaar@materna.de> 01/25/00 08:51am >>>
> Hello
>
> Can anybody tell if it possible to ask for tupel in a
> select statement ?
> An example:
>
> Normaly : select id from tab1 where ( a=2 and b=3 ) or
> ( a=3 and b=7 ) or
> ( a=5 and b=10)
>
> Wanted somthing like this:
>
> select id from tab1 where (a,b) in ({2,3},{3,7},{5,10})>
> Also i was interested if the normaly case could be simplified.
>
> THANX to ALL
>
> Thorsten
>
> ------------------------------------------------------
> Thorsten Geelhaar Telefon: +49 231 5599 106
> Dr. Materna GmbH Fax : +49 231 5599 100
>
> Vosskuhle 37 e-mail : Thorsten.Geelhaar@materna.de
> D-44141 Dortmund GERMANY
> ------------------------------------------------------