いつもありがとうございます。
前回動画と今回動画で共にエラー1064が発生してます。
ちなみに前回の AS num
で連番に抽出するところまではうまく動きました。
RANK
からコードをコピペしても、ドロップ後にやり直しても解決しなかったため質問しております。
原因は何でしょう・・・。
SELECT *,
ROW_NUMBER() OVER (ORDER BY likes) AS num,
RANK() OVER (ORDER BY likes) AS rank,
DENSE_RANK() OVER (ORDER BY likes) AS dense
FROM posts;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rank, DENSE_RANK() OVER (ORDER BY likes) AS denseFROM posts' at line 1
SELECT *,
LAG(likes, 1) OVER (ORDER BY likes) AS lag,
LEAD(likes, 1) OVER (ORDER BY likes) AS lead FROM posts;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lag,
LEAD(likes, 1) OVER (ORDER BY likes) AS lead FROM posts' at line 1
この回答を見るにはプレミアムプランへの登録が必要です
プレミアムプランとは?