select max(A),
[max(A)对应C的值]=(select top 1 c from 表 where A=(select max(A) from 表 where d = aa.d)),
max(B),
[max(A)对应C的值]=(select top 1 c from 表 where B=(select max(B) from 表 where d = aa.d)),
from 表 aa
[max(A)对应C的值]=(select top 1 c from 表 where A=(select max(A) from 表 where d = aa.d)),
max(B),
[max(A)对应C的值]=(select top 1 c from 表 where B=(select max(B) from 表 where d = aa.d)),
from 表 aa
[max(A)对应C的值]=(select top 1 c from 表 where A=(select max(A) from 表)),
max(B),
[max(A)对应C的值]=(select top 1 c from 表 where B=(select max(B) from 表))
from 表
select max(A),
[max(A)对应C的值]=(select top 1 c from 表 aa where A=(select max(A) from 表 where d = aa.d)),
max(B),
[max(A)对应C的值]=(select top 1 c from 表 aa where B=(select max(B) from 表 where d = aa.d)),
from 表
select D,max(A),
(select top 1 c from 表 where d=tem.d and A=(select max(A) from 表)) [max(A)对应C的值],
max(B),
(select top 1 c from 表 where d=tem.d and B=(select max(B) from 表)) [max(A)对应C的值]
from 表 tem group by D
(select top 1 c from 表 where d=tem.d and A=(select max(A) from 表 where d=tem.d)) [max(A)对应C的值],
max(B),
(select top 1 c from 表 where d=tem.d and B=(select max(B) from 表 where d=tem.d)) [max(A)对应C的值]
from 表 tem group by D
select * from 表 tem where A=(select max(A) from 表 where D=tem.D)) a,(
select * from 表 tem where B=(select max(B) from 表 where D=tem.D)) b where a.D=b.D