0
How to add directly to the query MYSQL when the field is sweep and need to delete some strings.
Example:
+------------+
|valor_total |
+------------+
|R$ 2.277,90 |
|R$ 3.217,30 |
|R$ 9.857,40 |
+------------+
The attempt below returns me sum = 0
SELECT REPLACE(valor_total, 'R$', ''), SUM(valor_total) AS TotalDaSoma FROM carrinho WHERE representante_id='92'
My Lady, "what a field" bug! Why don’t you use a
decimal
at least, and does formatting by the application or in the query itself? That’s a mess.– rbz
I did not ask for logical or aesthetic opinion and yes solution to question , even so thank you !
– denis
So you don’t understand the concept of the OS. If you just want to play question and have the answer ready, you’re doing it wrong. But good luck there! ✌
– rbz
You could make your criticism by presenting an answer! It’s not often that a client wants to update their algorithm and that’s the case, where I need to solve the problem with these features. What you said is the obvious, I think you who does not understand the concept of the platform.
– denis
Already have 2 answers, very good. I put in the comment exactly to add. What I said is obvious, but since there’s no reason to use it that way, there’s no way I can guess. And if I do not understand the concept, then who created this field understands of what? ... What a complication for a simple tip right!?
– rbz
Yes let’s not argue, everyone has their understandings ! I understand what you meant too, but in the end everyone is satisfied, with each other answers with scores ! I think it’s important for people to participate!
– denis
Absolutely! The idea was to help, if the way to talk sounded aggressive, I apologize! And in need, we are there! ✌
– rbz
Yes, if you need us !
– denis