Fix SQL query for closed issues in launchpad