select A.ID,
(case B.Name when B.Name then B.Name else C.Name end )as 'Name',
.....
from A
left join B on A.ID=B.ID
left join C on A.ID=C.ID
......
where ...
group by ...
意思就是说,如果B表的某个字段为空,那么就去C表的对应字段的值
select A.ID,
(case B.Name when B.Name then B.Name else C.Name end )as 'Name',
.....
from A
left join B on A.ID=B.ID
left join C on A.ID=C.ID
......
where ...
group by ...
意思就是说,如果B表的某个字段为空,那么就去C表的对应字段的值