pre_sql_to_query function

Return SQL transform of tokens.