标题:报错如题:The query could not be executed in the allotted memory.
只看楼主
刘七七
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2020-10-21
 问题点数:0 回复次数:0 
报错如题:The query could not be executed in the allotted memory.
以下query, 需要在倒数第二行增加一个或者条件,使其变为:

“WHERE ROW_COUNT = 2 or ROW_COUNT =1 and (DAYOFWEEK(SNAPSHOT_TIMESTAMP) = 7 or SNAPSHOT_TIMESTAMP = MAX_SNAPSHOT_DT))”

但是写完就报错如题:The query could not be executed in the allotted memory.  求解求解求解~

SELECT InputIMEI, InputCarrier, InputProgramName, InputStoreID, InputAddress, InputCity, InputState, InputZip, ActivationDate, LastLoginDate, DeviceStatus, ActiveDeviceCnt, DeviceMatchCnt, TotalIMEIs, TotalActivatedIMEI, LatestDeviceEventTime
, a.SNAPSHOT_TIMESTAMP as SNAPSHOT_TIMESTAMP, MAX(a.SNAPSHOT_TIMESTAMP) OVER () as MAX_SNAPSHOT_DT, b.SNAPSHOT_DATE as SNAPSHOT_DATE
FROM [] a
JOIN
((SELECT * FROM
  (SELECT SNAPSHOT_TIMESTAMP
    , DATE(SNAPSHOT_TIMESTAMP) as SNAPSHOT_DATE
    , COUNT(SNAPSHOT_TIMESTAMP) OVER (PARTITION BY SNAPSHOT_DATE ORDER BY SNAPSHOT_TIMESTAMP) as ROW_COUNT
    , MAX(SNAPSHOT_TIMESTAMP) OVER () as MAX_SNAPSHOT_DT
  FROM []
  WHERE DATE(SNAPSHOT_TIMESTAMP) >= '2019-03-01'
  GROUP BY 1,2 order by 1 desc)
WHERE ROW_COUNT = 2 and (DAYOFWEEK(SNAPSHOT_TIMESTAMP) = 7 or SNAPSHOT_TIMESTAMP = MAX_SNAPSHOT_DT))
) b
ON a.SNAPSHOT_TIMESTAMP = b.SNAPSHOT_TIMESTAMP
搜索更多相关主题的帖子: the query memory 报错 not 
2020-10-21 14:02



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-503558-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.295419 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved