[英]How to select left table, order by max date of the right table and max date is less than or equal to NOW()?
[英]Get statistic for author on max date less than or equal to a certain date
以下查詢是我要嘗試執行的偽代碼。
由於普及率不是max(dt)
上的受歡迎度,因此這是行不通的。
select authors,max(dt),popularity from author_info.performance
where dt<='20070201'
group by authors
有沒有辦法在沒有加入的情況下完成此任務?
有N個作者,對author.max(dt).popularity
具有一對一映射(以“。”表示法表示最終結果)。
我認為您打算檢查像這樣的HAVING
子句中的條件
select authors,
popularity
from author_info.performance
group by authors
having max(dt) <= '20070201';
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.