Function IN Subquery

69 views
Skip to first unread message

Blazej Netproces

unread,
Feb 11, 2025, 1:40:46 PMFeb 11
to nhusers
Hi everyone,

I'm looking for help with creating a query that involves a function IN subquery. For example, in SQL I Would write something like:

SELECT *
FROM Table t1
JOIN Table t2 ON t1.Id = t2.Table1Id
WHERE CONCAT(t1.Id, t2.Id) IN (
       SELECT CONCAT(t1sub.Id, t2sub.Id)
       FROM Table1 t1sub
       JOIN Table2 t2sub ON t1sub.Id = t2sub.Table1Id
       WHERE t1.Date < '2025-02-11'
              AND t2sub.Name like '%something%')

I need to implement a similar subquery for filtering and paginating data in NHibernate.
I discovered the WhereProperty method, but it requires a specific property. 
Subqueries.In does not seem to help in this case.

Is it possible to achieve this funcionality with NHibernate? Any suggestions or guidance would be greatly appreciated.

Thanks for advance!
Reply all
Reply to author
Forward
0 new messages