Reputation: 11
I want to select the values from a column name with non-ascii characters but It cant be possible.
The column name is "Descripón" and I want to remove the "ó" and transform it in à ³
.
How can I make the select?
Upvotes: 0
Views: 347
Reputation: 562230
You can use special characters if you use delimited identifiers:
mysql> create table mytable ( `Descripón` text );
Query OK, 0 rows affected (0.03 sec)
mysql> insert into mytable (`Descripón`) values ('hello world');
Query OK, 1 row affected (0.01 sec)
mysql> select `Descripón` from mytable;
+--------------+
| Descripón |
+--------------+
| hello world |
+--------------+
If you want to change the column name to only ASCII characters so you can use it subsequently without delimiting it:
mysql> alter table mytable change column `Descripón` Description text;
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> select Description from mytable;
+-------------+
| Description |
+-------------+
| hello world |
+-------------+
But you cannot use HTML entities like ó
in MySQL queries, sorry.
Upvotes: 2