1
votes

I am trying to create table using source data (base_temp).

create table t as (select a,b,c , (select case when d>f then "yes" else null end as month_since from (select case when g<h then 1 else 0 end as le_done) from base_temp)) as month_since 
from base_temp where a>b);

can someone help me what is the issue here