Последний sql запрос:

select "ROLE_ACL"."RESOURCEFK","RIGHTS"."ID" from "ROLE_ACL"
inner join "RIGHTS" on ("ROLE_ACL"."RIGHTFK" = "RIGHTS"."SYS_GUID" and mod(coalesce("RIGHTS"."SYS_STATE",0),2)=0)
where "ROLE_ACL"."ALLOW" = 1 and mod(coalesce("ROLE_ACL"."SYS_STATE",0),2)=0
and "ROLE_ACL"."RESOURCEFK" in ('pages') and "ROLE_ACL"."SYS_GUIDFK" in ('readonly')