开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜