Reputation: 1068
I have a column named 0
in the table mytable
.
I want to select the contains of this column. when I tried with:
SELECT 0 FROM mytable WHERE key_id = '8'
It didn't show the column's data but it shows only the value 0 but this column doesn't have the 0 value. How can I get the contents of this column?
Upvotes: 0
Views: 58
Reputation: 13474
create table test(`0` INT,key_id int );
INSERT INTO test VALUES(1,8);
SELECT `0` FROM test where key_id=8;
Upvotes: 1
Reputation: 4888
create table test_0(`0` INT );
INSERT INTO test_0 VALUES(1);
SELECT `0` FROM test_0;
+------+
| 0 |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
Upvotes: 2
Reputation: 2729
Since zero is a number you need to specify it with the back ticks
SELECT `0` FROM mytable WHERE key_id = '8'
Upvotes: 3