NoSQLを知らんわいに教えてほしいんやけど、例えば

with(
select A
from BB
left join CC ON BB.A=CC.A
where BB.z>CC.x
) as DD

select FF.*
from FF
where exists(select * from DD where DD.A=FF.A)

みたいなSQLの内容で仕様書書いてあったらどう書くん?