在我的值中,我有字符'并且我得到一个错误。
我该如何解决?
UPDATE products
SET description = CASE
WHEN id <= 350 THEN 'Sample description with ' character'
ELSE 'sample description 2'
END
在我的值中,我有字符'并且我得到一个错误。
我该如何解决?
UPDATE products
SET description = CASE
WHEN id <= 350 THEN 'Sample description with ' character'
ELSE 'sample description 2'
END
SQL中转义字符的常用方法是\所以
UPDATE products
SET description = CASE
WHEN id <= 350 THEN 'Sample description with \' character'
ELSE 'sample description 2'
如果你想知道如何在里面放一个\,你只需把它加倍,即\\
phpMyAdmin将引号加倍。你可以这样做:
UPDATE `products`
SET `description` = CASE
WHEN `id` <= 350 THEN 'Sample description with '' character'
ELSE 'sample description 2'
END
双引号:
UPDATE products
SET description = CASE
WHEN id <= 350 THEN 'Sample description with '' character'
ELSE 'sample description 2'
END