Display post x of y within category

Raw SQL is inconvenient.

You can use get_posts() (or WP_Query which it wraps) with 'fields' => 'ids' (see fields parameter ) for lightweight counting, while retaining compatibility with all arguments it accepts, including category parameters