I copied and pasted exactly as you gave above, with no changes, and I have no errors. I also ran it to make sure, and it worked.
Try copying the above and pasting with no formatting (CTRL-SHIFT-V) into a new query (don’t paste over the existing one in case there’s some bizarre whitespace or formatting issues).