Difference between revisions of "Apostrophe"

From SQLZOO
Jump to: navigation, search
Line 1: Line 1:
 
How to build a statement on a word with an Apostrophe such as WHERE name='Tom's Book'
 
How to build a statement on a word with an Apostrophe such as WHERE name='Tom's Book'
 
<div class='ht'>
 
<div class='ht'>
 +
<div class=params>schema:scott</div>
 
<div>
 
<div>
 
</div>
 
</div>
<source lang=sql class='tidy'>
+
<source lang=sql class='tidy'>DROP TABLE cia;
 +
</source>
 +
<source lang=sql class='setup'>CREATE TABLE cia(name VARCHAR(10), region VARCHAR(10));
 +
INSERT INTO cia VALUES ('Cote d''Ivoire', 'Africa');
 +
INSERT INTO cia VALUES ('Japan', 'Asia');
 
</source>
 
</source>
 
<source lang='sql' class='def e-oracle e-postgres e-mysql e-sqlserver'>SELECT * FROM cia
 
<source lang='sql' class='def e-oracle e-postgres e-mysql e-sqlserver'>SELECT * FROM cia

Revision as of 12:22, 12 July 2012

How to build a statement on a word with an Apostrophe such as WHERE name='Tom's Book'

schema:scott
DROP TABLE cia;
CREATE TABLE cia(name VARCHAR(10), region VARCHAR(10));
INSERT INTO cia VALUES ('Cote d''Ivoire', 'Africa');
INSERT INTO cia VALUES ('Japan', 'Asia');
SELECT * FROM cia
WHERE name = 'Cote d''Ivoire'
SELECT * FROM cia
WHERE name = 'Cote d''Ivoire'
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense