I have the following table:
CREATE TABLE `providers` (
`id` int(10) NOT NULL auto_increment,
`name` varchar(255) default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
) ENGINE=InnoDB AUTO_INCREMENT=1392 DEFAULT CHARSET=latin1;
I try to contact id
and name
in a query:
SELECT id, name, CONCAT("[", id, "] ", name) AS value FROM providers;
It works great for most entries. However, when name
has characters with accents, I get a malformed string:
+-----+-------------------------+-------------------------+
| id | name | value |
+-----+-------------------------+-------------------------+
| 138 | ÁREA TECNOLÓGICA | [138] �REA TECNOL�GICA |
+-----+-------------------------+-------------------------+
Is there any way to fix it in the SQL level?