This statement uses FIRST N , LIMIT N or SKIP M inside a subquery. This action is not supported.
Review the use of FIRST N and check that it is applied only to the outer main query SELECT clause.