簡體   English   中英

獲取最大日期小於或等於某個日期的作者的統計信息

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM