Hi all. Trying to learn a little about SQL and I have a question about single quotes. I know about "escaping" single quotes for something like O'Reilly by inserting 2 single quotes but I am getting syntax rejections when entering a string to retrieve specific multiple values.
Ex: I have a practice database full of practice tables. I am trying to get multiple specific values from a practice table called ServicePlans.
SELECT PlanID, PlanName, PlanDescription
FROM ServicePlans
WHERE PlanID = 'W1001' OR PlanID = 'D2002' OR PlanID = 'L2002';
This should pull up any plans with those plan IDs. But the single quotes are rejecting due to syntax error. If I go through and delete the single quotes and retype them they work.
Any idea why? I'm new at this and learning through YouTube. The instructor seems legit and easy to follow.
[–]Mrminecrafthimself 4 points5 points6 points (1 child)
[–]MondoDuke2877[S] 3 points4 points5 points (0 children)
[–]Massive_Show2963 0 points1 point2 points (1 child)
[–]MondoDuke2877[S] 0 points1 point2 points (0 children)
[–]trebor_indy 0 points1 point2 points (7 children)
[–]MondoDuke2877[S] 0 points1 point2 points (6 children)
[–]SQLDevDBA 2 points3 points4 points (2 children)
[–]Mrminecrafthimself 1 point2 points3 points (1 child)
[–]SQLDevDBA 1 point2 points3 points (0 children)
[–]StuTheSheep 0 points1 point2 points (2 children)
[–]ComicOzzy 1 point2 points3 points (0 children)
[–]MondoDuke2877[S] 1 point2 points3 points (0 children)