XF 2.2 Is there a way to use Union with the finder?

I want to retrieve a list of threads using an Union in the query. Is there a way to translate this query to the finder?

Code:
SELECT * FROM (
    (
        SELECT xt.*
        FROM xf_thread xt
        WHERE xt.node_id = 100
        ORDER BY xt.last_post_date DESC LIMIT 20
    )
    union
    (
        SELECT xt.*
        FROM xf_thread xt
        INNER JOIN xf_slinking xs ON xs.thread_id = xt.thread_id
        WHERE xs.node_id = 100
        ORDER BY xt.last_post_date DESC LIMIT 20
    )
) U ORDER BY last_post_date DESC LIMIT 20;
 

TickTackk

Well-known member
Finder does not support UNON yet. I might be wrong but going with LEFT instead of INNER join should yield the same results.
 
Top