I have a somewhat complicated select query which returns, in part, the following resultset (as an example):
threadid views
-------- -----
1 5
1 5
2 10
3 15
4 10
If I were to do the following select:
COUNT (DISTINCT threadid), SUM (DISTINCT views)
then it would return 4, 30. (5 + 10 + 15)
I am looking for a select where I want to find the SUM of views for distinct threadids, not distinct views. Something that would return 4, 40. (5 + 10 + 15 + 10) Is there something I can do?