Reputation: 170
I export a CSV-File with shipping weights from my webshop. The problem is there are bulk numbers and no unit Like this:
+------+------+
| ID |weight|
+------+------+
| 101 | 1,2 |
+------+------+
| 102 | 2,5 |
+------+------+
But I need a result like this:
+------+------+
| ID |weight|
+------+------+
| 101 |1,2 kg|
+------+------+
| 102 |2,5 kg|
+------+------+
This is the statement:
SELECT id_product AS `ID`, weight AS `weight` FROM products
Is it possible to add a string ('kg') into the SELECT statement or something of a kind? Or are there other possible solutions? (The system works with SELECT only)
Upvotes: 1
Views: 42
Reputation: 5141
Please use below query,
SELECT id_product AS `ID`, weight || ' Kg' AS `weight` FROM products
You can also use CONCAT() function instead.
Upvotes: 0
Reputation: 310
Please try the below query.
SELECT id_product AS `ID`, CONCAT(weight ,' kg') AS `weight` FROM products
Hope will help you
Upvotes: 3