Single Amp SQL Issue

Analytics

Single Amp SQL Issue

I'm trying to create a flat file, with a delim of ;, and without spaces between each column. The query I'm using below doesn't work in Fast Export due to it running on a single amp. When I remove the trim criteria, it runs without issue. What would cause the single amp error to occur when running this sql below? Thanks in advance for your help!

select
substring(trim(col1) from 1 for 10) || ';',
substring(trim(col2) from 1 for 10)||';',
substring(trim(col3) from 1 for 1)||';',
substring(trim(col4) from 1 for 5)||';'
FROM

where col1 in (criteria);