Your query is most likely incorrect. The LIST function returns a
VARCHAR, so if x returns, say, two rows with 5 and 7, then list will
create the string '5,7' (or '7,5', your query does not specify any
order) and IN ('5,7') is very different from IN('5', '7'). Your query
would only return rows
HiWhy "list(x.tbl2_pk_id)"?Result of list is a blob string with one single
value like '1,2,3' not a 3 records '1', '2', '3'.And using "in" is not a good
choice here. Change query to e.g. 'exists' or better some 'join'Regards,Karol
Bieniaszewski
null
On 2019-12-30 17:57, Germán Balbi bal...@yahoo.com [firebird-support]
wrote:
> Hi.
> I have this problem in FB 2.5
>
> with x as (
> SELECT *
> FROM tbl_x1
> JOIN tbl_fk1 ON cond_1
> WHERE cond_w1
> UNION
> SELECT *
> FROM tbl_x1
> JOIN tbl_fk1 ON cond_2
> WHERE cond_w2
> )
>
>
30.12.2019 17:57, Germán Balbi bal...@yahoo.com [firebird-support] wrote:
> How can I specify the right plan?
Your strange query cannot work at all. Natural scan is unavoidable with it.
--
WBR, SD.