Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
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 (119k 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

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
2 answers

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...