I have a database table (notes) that has three columns: id, ticket, and user.
I need to show how many notes were entered by each user as well as how many unique tickets those notes were added to (grouped by user). For example, John Doe entered 100 notes into 50 unique tickets and Jane Doe entered 70 notes into 65 unique tickets. I'm not interested in which tickets they were added to, just how many.
Here is what I have so far.
select count(id) count
from notes
group by user
Is it possible to grab the number of unique tickets in the same query?