Finished many functions abouti combine sql.