select aid
, (select top 1 field1 from tb1 as b where a.aid=b.aid and field1<>'')
, (select top 1 field2 from tb1 as b where a.aid=b.aid and field2<>'')
, .....
from tb1 as a
group by aid