ソースコード
update ITEM 
set ITEM.ITEM_POPULAR_RANK = B.ida
from
(
select row_number() over (partition by it.ITEM_CODE order by cnt, desc,dt desc, it.ITEM_CODE desc) as ida
, it.ITEM_CODE , cnt, max(ORDER_DATE) as dt from ITEM as it
   left join ORDERS_DTL as od on od.ITEM_CODE  = it.ITEM_CODE 
   left join ORDERS as o on o.ORDER_NO = od.ORDER_NO
   inner join (
   select it.ITEM_CODE , ifnull(sum(ORDER_QTY),0) as cnt from ITEM as it
   left join ORDERS_DTL as od on od.ITEM_CODE  = it.ITEM_CODE 
   left join ORDERS as o on o.ORDER_NO = od.ORDER_NO

   group by it.ITEM_CODE
   order by cnt desc
) as temp on temp.ITEM_CODE = it.ITEM_CODE

   group by it.ITEM_CODE
   order by cnt, desc,dt desc, it.ITEM_CODE desc) as B
   where ITEM.ITEM_CODE = B.ITEM_CODE

提出情報
提出日時2023/08/21 11:34:01
コンテスト第8回 SQLコンテスト
問題人気順位
受験者ryo_tokyo
状態 (詳細)RE
(Runtime Error: 実行時エラー)
メモリ使用量101 MB
メッセージ
SQLITE_ERROR: near ".": syntax error
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
RE
99 MB
データパターン2
RE
101 MB