日期:2014-05-18 浏览次数:20515 次
create table tableA(fieldA int,fieldB int) insert into tablea values(1 ,2) insert into tablea values(1 ,3) insert into tablea values(2 ,1) insert into tablea values(2 ,4) insert into tablea values(2 ,2) insert into tablea values(1 ,1) insert into tablea values(2 ,4) go select fieldA , max(fieldB) fieldB from tablea group by fielda drop table tablea /* fieldA fieldB ----------- ----------- 1 3 2 4 (所影响的行数为 2 行) */