Added support for using sub-queries when building a DB query with `IN` condition