Put quite simply:
SELECT 'This is Ashok''s Pen.';
So inside the string, replace each single quote with two of them.
Or:
SELECT 'This is Ashok\'s Pen.'
Escape it =)
More Related Contents:
- When to use single quotes, double quotes, and backticks in MySQL
- How can I output MySQL query results in CSV format?
- How to convert a string to date in MySQL?
- How to find similar results and sort by similarity?
- How do I do a fuzzy match of company names in MYSQL with PHP for auto-complete?
- How do you extract a numerical value from a string in a MySQL query?
- SQL order string as number
- How to remove all non-alpha numeric characters from a string in MySQL?
- MySQL – length() vs char_length()
- Capitalize first letter. MySQL
- Can MySQL replace multiple characters?
- How to fix double-encoded UTF8 characters (in an utf-8 table)
- MySql – Way to update portion of a string?
- mysql: why comparing a ‘string’ to 0 gives true?
- MySQL : how to remove double or more spaces from a string?
- Strip last two characters of a column in MySQL
- MySql Query Replace NULL with Empty String in Select
- Last index of a given substring in MySQL
- How to create a MySQL hierarchical recursive query?
- MySQL Error 1215: Cannot add foreign key constraint
- Add Foreign Key to existing table
- Auto Generate Database Diagram MySQL [closed]
- Error #2002 Can’t connect to local MySQL server through socket ‘/Applications/MAMP/tmp/mysql/mysql.sock’ (2)
- How to get the max of two values in MySQL?
- how to partition a table by datetime column?
- MySQL – Cannot insert NULL value in column, but I have a default value specified?
- uninitialized constant MysqlCompat::MysqlRes (using mms2r gem)
- Migrating data into Firebase from MySQL
- Inventory management with stock options
- Working with INTERVAL and CURDATE in MySQL