直播观众数.sql 310 B

12345678910
  1. select sum(count) as fcustcount
  2. from (
  3. select ROW_NUMBER() over(partition by t1.channelid order by t1.time desc)as num,
  4. t1.count
  5. from tlive_usercount t1
  6. inner join tlive t2 on t1.channelid = t2.channelid --and t2.livestatus='live'
  7. ) t
  8. where t.num = 1