我有一个像这样的mysql字段:
url_id time_spent
------- ----------
120 14
120 97
120 14
120 97
我想基于url_id(DISTINCT)仅显示14和97。
答案 0 :(得分:2)
select * from table group by url_id,time_spent
答案 1 :(得分:1)
SELECT DISTINCT a.url_id, a.time_spent FROM table a