0 votes
1 view
in SQL by (20.3k points)

How do I insert a record in a column having varchar data type having single quote in it?

Example: first name is ROBERT and last name is D'COSTA

1 Answer

0 votes
by (72.4k points)

Here is the SQL query in Oracle to insert a record that contains a single quote:

SELECT Q' [D'COSTA] ' FROM DUAL;

or you can use two single quotes instead of single quotes.

SELECT 'D''COSTA' name FROM DUAL;

You can check out this SQL tutorial to learn the fundamentals of SQL and can check out this SQL Course to get expertise in SQL.

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...