Strip trailing comma from subquery