mysql query for both distinct and sum
I have a mysql fields like this:
url_id time_spent
------- ----------
开发者_如何转开发120 14
120 97
120 14
120 97
I want to display only 14 and 97 based on url_id(DISTINCT).
select * from table group by url_id,time_spent
SELECT DISTINCT a.url_id, a.time_spent FROM table a
精彩评论