Wholesale retailer Costco Wholesale (COST) delivered solid earnings for its second quarter of fiscal year 2023, even as weaker sales pushed shares lower.