Difference between revisions of "Column name with spaces"

From SQLZOO
Jump to: navigation, search
(Created page with "SELECT a column whose name contains spaces? <div class='ht'> <div> You can access columns where the name contains a space. </div> <source lang=sql class='tidy'>DROP TABLE Spac...")
 
 
Line 1: Line 1:
 
SELECT a column whose name contains spaces?
 
SELECT a column whose name contains spaces?
 
<div class='ht'>
 
<div class='ht'>
 +
<div class=params>schema:scott</div>
 
<div>
 
<div>
 
You can access columns where the name contains a space.
 
You can access columns where the name contains a space.

Latest revision as of 13:21, 12 July 2012

SELECT a column whose name contains spaces?

schema:scott

You can access columns where the name contains a space.

DROP TABLE SpaceMonster
CREATE TABLE SpaceMonster([Account Balance] INT);
INSERT INTO SpaceMonster VALUES (42);
SELECT [Account Balance] FROM SpaceMonster
CREATE TABLE SpaceMonster(`Account Balance` INT);
INSERT INTO SpaceMonster VALUES (42);
SELECT `Account Balance` FROM SpaceMonster
CREATE TABLE SpaceMonster("Account Balance" INT);
INSERT INTO SpaceMonster VALUES (42);
SELECT "Account Balance" FROM SpaceMonster
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense