I have a table and I’m trying to retrieve any row which has a number in it
For example this:
+----------+--------------+
| Name | age |
+----------+--------------+
| name1 | 21 |
| name2 | 22 |
| name3 | 21 |
+----------+--------------+
I tried this:
SELECT * FROM table WHERE 'age' = 21;
the message I get from the is
Empty set, 1 warning (0.00 sec)
I’m not to sure what I’m doing wrong?
The issue is
'age'. You don’t need to use quotes nearage.See this SQLFiddle.
Instead of quotes you can use Backtick (`).
Also, Don’t use Reserved Words as you use in table name.