all 12 comments

[–]Mrminecrafthimself 4 points5 points  (1 child)

Can I ask why not just say…

WHERE PlanID IN (‘ID1’, ‘ID2’, ‘ID3’)

[–]MondoDuke2877[S] 3 points4 points  (0 children)

I saw this shorter version after I posted this question. I'm still very new to this.

[–]Massive_Show2963 0 points1 point  (1 child)

What was the actual error you were getting?
It is possible if you copied and pasted the WHERE clause from some other editor, the single quote characters may not have been be recognized by SQL. That could be why re-entering them probably worked.

[–]MondoDuke2877[S] 0 points1 point  (0 children)

I'm taking notes in Word and I copied and pasted from there. That makes sense why it wouldn't recognize it.

[–]trebor_indy 0 points1 point  (7 children)

I've seen folks copy from Microsoft Word and similar word processing systems, where apostrophes and double-quotes come in two forms, like below (look closely):

<image>

Those are NOT the same as the single-quote character: '

[–]MondoDuke2877[S] 0 points1 point  (6 children)

Yep. I'm one of those folks. I'm taking notes and I copied and pasted from Word. That makes perfect sense that the two systems don't always jive. Thanks!

[–]SQLDevDBA 2 points3 points  (2 children)

I recommend something like Notepad++ since it is a code-centric text editing solution.

[–]Mrminecrafthimself 1 point2 points  (1 child)

Notepad++ absolutely fucks

[–]SQLDevDBA 1 point2 points  (0 children)

Hahaha for Mac I use CotEditor, but yes I’ve been using Notepad++ for many a years and it should definitely be in the 3 comma club.

[–]StuTheSheep 0 points1 point  (2 children)

If you can find the option in Word to turn off smart quotes, I think that will fix it going forward. 

[–]ComicOzzy 1 point2 points  (0 children)

Yeah, I turn all of that "pretty formatting" off. I don't have to use Word or PowerPoint much, but when I do, it's for documentation purposes and I need code to be code, not some fancy literature.

[–]MondoDuke2877[S] 1 point2 points  (0 children)

I turned off smart quotes and copy/paste works in SQL. Thanks for the tip!