When I have a situation where I need a subquery in AX I normally join on the same table in most cases with an exists / not exists join
Pseudo code
select StatRepInterval exists join StatRepInterval2
order by StatRepInterVal2 desc
where StatRepInterval.RecId = StatRepInterval2.RecId
&& StatRepInterval2.PrintDirection == 1