Query mysql to sprunje format

I want to convert a mysql query to the Sprunje format. I have read the tutorials and manuals, but I can not get UF to accept the query.

Query mysql:
SELECT id_alu, nombre, max_est, estado FROM app_asistencia_estado INNER JOIN (SELECT id_alumno_fk as id_alu, MAX(id_estado_fk) as max_est FROM app_asistencia GROUP BY id_alumno_fk) as tmax ON app_asistencia_estado.id = tmax.max_est INNER JOIN app_alumno ON app_alumno.id = tmax.id_alu

I need help, thanks.