SQL 结果集过滤,求高手指点,在线等待

id(列别名,不是有规律的数字) name time (n 个字段)

1 中国 3-14

1 null 3-14

1 null 3-14

2 null 3-15

3 美国 3-16

3 null 3-16

用distinct没效果

想过滤之后的效果是这样的

1 中国 3-14

2 null 3-15

3 美国 3-16

怎么用SQL语句实现
求高手指点,在线等待

select distinct id,time from table as a
join (select id,name from table where name is not null) as b on a.id=b.id

明白意思不