Fixed SQL query.