如何查询所有股票最后时间点的数据?

如何查询所有股票最后时间点的数据?

iv_data = select * from iv where date(trigger) = today(),time(trigger) = 14:55:00 context by code,KPrice   

这是我的一条查询代码,现在的问题是,不是所有code都在14:55有数据,比如ma406 最后的数据是14:33

请先 登录 后评论

1 个回答

veryOrdinary

直接用 context by + csort + limit -1即可

 iv_data = select * from iv where date(trigger)=today() context by code,KPrice csort trigger limit -1


请先 登录 后评论
  • 1 关注
  • 0 收藏,343 浏览
  • Polly 提出于 2023-11-10 16:25

相似问题