Updated sql statement