format sql statement