Yii2超过分区到activerecord

时间:2019-04-03 14:30:12

标签: activerecord yii2

SELECT
  mksg_id,
  valid_from,
  price
FROM (SELECT
  prices.*
  , MAX(valid_from) OVER (PARTITION BY mksg_id) max_date
FROM prices) s
WHERE valid_from = max_date

如何将其转换为ActiveRecord?谢谢。

0 个答案:

没有答案