Query annotation supports JQL queries and native SQL queries. It uses your underlying JPA provider which in turn runs
JDBC queries against the database. So, the kind of queries that you can run will be limited to the JPA provider and the database. If the database doesn't support nested queries then Spring Data won't support nested queries
Look at the documentation of the JPA provider and database to figure out if nested queries are supported.