ソースコード
with subq as(
select CONTEST_ID
        ,USER_ID
        ,max(SUBMITTED_AT) as lasttime
        from SUBMISSIONS 
        where STATUS = 'AC'
group by CONTEST_ID
        ,USER_ID
)

, time as(
select A.CONTEST_ID
        ,A.USER_ID
        ,STARTED_AT as starttime
        ,lasttime
        ,strftime('%s', lasttime) - strftime('%s', STARTED_AT) as time
from subq A
left outer join ENTRIES B
on A.CONTEST_ID = B.CONTEST_ID
and A.USER_ID = B.USER_ID
)


, point as (

select CONTEST_ID
        ,USER_ID
        ,sum(POINT) as point 
        ,sum(case when STATUS = 'WA' then 1 else 0 end) as WA_count
        from SUBMISSIONS 
group by CONTEST_ID
        ,USER_ID
)

, WA_count as (

select CONTEST_ID
        ,USER_ID
        ,sum(case when STATUS = 'WA' then 1 else 0 end) as WA_count
        from SUBMISSIONS 
group by CONTEST_ID
        ,USER_ID
)

select row number over ()
	,A.USER_ID
	,point 
	,time + (C.WA_count * 300) as extime
	,C.WA_count as WRONG_ANS
from point as A
left outer join time as B
on A.CONTEST_ID = B.CONTEST_ID
and A.USER_ID = B.USER_ID
left outer join WA_count as C
on A.CONTEST_ID = C.CONTEST_ID
and A.USER_ID = C.USER_ID
where A.CONTEST_ID = 2
and point > 0 
order by point,time

提出情報
提出日時2022/10/19 15:49:31
コンテスト第3回 SQLコンテスト
問題順位計算
受験者asterect
状態 (詳細)RE
(Runtime Error: 実行時エラー)
メモリ使用量95 MB
メッセージ
SQLITE_ERROR: near "over": syntax error
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
RE
89 MB
データパターン2
RE
95 MB