Collections:
QUOTE() - MySQL Quoting String
How to escape quotes in string to be used in MySQL statements using the QUOTE() function?
✍: FYIcenter.com
QUOTE(str) is a MySQL built-in function that
escapes quotes in a given string to be used in MySQL statements.
For example:
SELECT QUOTE("It's 5 o'clock!");
-- +--------------------------+
-- | QUOTE("It's 5 o'clock!") |
-- +--------------------------+
-- | 'It\'s 5 o\'clock!' |
-- +--------------------------+
Reference information of the QUOTE() function:
QUOTE(str): modstr
Escapes the sting str with each instance of backslash (\), single
quote ('), ASCII NUL, and Control+Z preceded by a backslash.
Arguments, return value and availability:
str: Required. The given string to be escaped
modstr: Return value. The escaped string.
Available since MySQL 5.7.
⇐ POSITION() - Synonym for LOCATE()
2023-11-13, 1033🔥, 0💬
Popular Posts:
How To Generate CREATE TABLE Script on an Existing Table in SQL Server? If you want to know how an e...
How To Verify a User name with SQLCMD Tool in SQL Server? The quickest way to verify a user name in ...
How To Generate Random Numbers with the RAND() Function in SQL Server Transact-SQL? Random numbers a...
How To Format Time Zone in +/-hh:mm Format in SQL Server Transact-SQL? From the previous tutorial, y...
Where to find answers to frequently asked questions on Conditional Statements and Loops in SQL Serve...