select ‘姓名’,‘性别’,max(‘时长’) from tablea group by ‘姓名’,‘性别’
select distinct ‘姓名’,‘性别’,max(‘时长’) from tablea group by ‘姓名’,‘性别’
select * form tablea where ‘姓名’,‘性别’,‘时长' in (select ‘姓名’,‘性别’,max(‘时长’) from tablea group by ‘姓名’,‘性别)
select a.* from table a, (select column a, column b, column c, column d, column e, max(column f) sc from table group by column a, column b, column c, column d, column e) b where a.column a = b.column a and a.column b = b.column b and a.column c = b.column c and a.column d = b.column d and a.column e = b.column e and a.column f = b.sc; 用这个语句就OK了,谢谢大家。
from tablea
group by ‘姓名’,‘性别’
from tablea
group by ‘姓名’,‘性别’
from tablea group by ‘姓名’,‘性别)
from table a,
(select column a,
column b,
column c,
column d,
column e,
max(column f) sc
from table
group by column a,
column b,
column c,
column d,
column e) b
where a.column a = b.column a
and a.column b = b.column b
and a.column c = b.column c
and a.column d = b.column d
and a.column e = b.column e
and a.column f = b.sc;
用这个语句就OK了,谢谢大家。