select case
when line = 'KEY'
then case
when length(pop)>0 and pop not rlike '^[0-9]+@.*'
then ''
else case
when pop rlike '^[0-9]+@.*'
then regexp_extract(pop, '^[^@]+', 0) end
else '' end as pop from input
The above code throughs the error "mismatched input 'line' expecting (line 1, pos 17)"
can anyone help me with this!


