Query Json with SQL where clause not working

select *, CAST(substring(title, -5) as int) as PropertyId
from {{ getAllTasks.data.value }} as allTasks

this returns data.

with result PropertyId:10002

but if I add

select *, CAST(substring(title, -5) as int) as PropertyId
from {{ getAllTasks.data.value }} as allTasks
where allTasks.PropertyId = 10002

nothing comes back...

Hi! You will need a subquery or you could just use JS in the where statement.

select * from (select *, CAST(substring(title, -5) as int) as PropertyId from {{ getAllTasks.data.value }} as allTasks) a where a.PropertyId = 10002