未测试:   SELECT d_id,
          d_channel,
          count(d_channel) as c
     FROM table
 GROUP BY d_channel
   HAVING c < 2
 ORDER BY time DESC
    LIMIT 20;