I'm at the end of a long day and have this major mind block . . . I'm sure it's staring me in the face but it's just not happening.
Table A. Call it customers, friends, whatever.
Table B holds the "credits" for the entities, joins on unique_id, there can be any number of rows, and the credits can vary in amount.
Easy enough to sum() the amounts for a given entity from table A.
How do I query a count(*) on the number of people with credits > 0? Doh!
Example, table B,
The query should return a single row, a count of 2: users 1234 and 1236 have credits > 0. My meager attempts are returning multiple rows.
<feelin' sharp tonight . . . >