开发者

mysql query for both distinct and sum

开发者 https://www.devze.com 2023-02-16 03:53 出处:网络
I have a mysql fields like this: url_idtime_spent ----------------- 开发者_如何转开发12014 12097 12014

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

精彩评论

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