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 class=params>schema:gisq</div>
 
<div>
 
<div>
 
</div>
 
</div>
<source lang=sql class='tidy'>DROP TABLE cia;
+
<source lang=sql class='tidy'></source>
</source>
+
<source lang=sql class='setup'></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 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
 
WHERE name = 'Cote d''Ivoire'</source>
 
WHERE name = 'Cote d''Ivoire'</source>

Revision as of 14:10, 12 July 2012

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

schema:gisq
 
 
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