fixed a bug in the SQL creator concearning function clauses in SELECT