Home > Mobile >  How to mark a string in Microsoft SQL
How to mark a string in Microsoft SQL

Time:12-06

Hy all, I have encountered a problem while cleaning some data where I can't seem to "mark" this string as a string. The problem is as follows:

select JobPosition,
case
when (JobPosition = 'Seniority level': 'Entry level'},) then 'Entry level'
else JobPosition
end
from JobsUSA 

So the 'Seniority level': 'Entry level'}, I can't put inside '' that to mark it as a string.

I've tried different versions of putting '' in all kinds of places but without luck. I'm relatively new in SQL so all help would be appreciated.

I've tried to Google the problem but I can't seem to find a solution

CodePudding user response:

you can use function cast(), for example: cast(expr AS type)

CodePudding user response:

When using single quotes in a quoted string you need to double them up - 'this string contains ''single'' quotes'

  • Related