R
RB Smissaert
I am trying to make a function to convert a query with one or multiple OR
conditions to a query with one or multiple
UNION's. The reason is that in my particular database (Interbase 5.6) the
UNION construction is a lot faster.
So, for example:
select
field
from
table
where
field like 'a%' or field like 'b%'
to
select
field
from
table
where
field like 'a%'
union
select
field
from
table
where
field like 'b%'
This is a simple example, but it can get more complex when there are NOT
conditions or IN constructions.
I was thinking maybe somebody of this NG has done this function already,
saving me reinventing the wheel.
It has to be coded in VB/VBA. I would like it to be a function that has the
orginal SQL as a string argument and the
new UNION SQL as the string result. I had a good search for this on the net,
but nil found.
Thanks.
RBS
conditions to a query with one or multiple
UNION's. The reason is that in my particular database (Interbase 5.6) the
UNION construction is a lot faster.
So, for example:
select
field
from
table
where
field like 'a%' or field like 'b%'
to
select
field
from
table
where
field like 'a%'
union
select
field
from
table
where
field like 'b%'
This is a simple example, but it can get more complex when there are NOT
conditions or IN constructions.
I was thinking maybe somebody of this NG has done this function already,
saving me reinventing the wheel.
It has to be coded in VB/VBA. I would like it to be a function that has the
orginal SQL as a string argument and the
new UNION SQL as the string result. I had a good search for this on the net,
but nil found.
Thanks.
RBS