Fixed SQL statement to match database