Subquery does not work

Hi,

I’m trying to execute a query with a subquery.
example : “SELECT X,Y,Z,(SELECT TOP 1 A FROM AA) AS P FROM BB”

Everything works fine until I want to use the subquery.
I receive an error on my query. When I run the query in an query editor everything works fine.

When I trace my executed queries then I see that the query that has been executed in de database is not the same as the example.
The executed query is “SELECT X,Y,Z,(SELECTA FROM AA) AS P FROM BB”

" TOP 1 " is deleted from the query.

Does any one has a solution for this?

Thanks

Try to use render_complex_sql instead of render_sql ( beware that will disable dyn. loading and auto-saving functionalities )