select
district,
d1,
its,
max(its) as maxits
from
table
group by
dl,its
where
d1<to_date('2004-11-5','yy_mm_dd')
and
d1>to_date('2004-10-5','yy_mm_dd')
district,
d1,
its,
max(its) as maxits
from
table
group by
dl,its
where
d1<to_date('2004-11-5','yy_mm_dd')
and
d1>to_date('2004-10-5','yy_mm_dd')
from table
where
d1<to_date('2004-11-5','yy_mm_dd')
and
d1>to_date('2004-10-5','yy_mm_dd')
group by district,d1,its;
from table
where
d1<to_date('2004-11-5','yy-mm-dd')
and
d1>to_date('2004-10-5','yy-mm-dd')
group by district,d1;
where
d1<to_date('2004-11-5','yy_mm_dd')
and
d1>to_date('2004-10-5','yy_mm_dd')
group by district,d1,its;
2、group by 后面的列名要包括前面 select 中的所有列。多谢各位的解答