i have an issue with this piece of code coming from SQL :
UPDATE resultats_du_jour
SET Heure_debut = CONCAT(SUBSTRING(Heure_debut,1,2) +
12,SUBSTRING(Heure_debut,3,3))
WHERE Heure_debut LIKE '%PM';
This gives me the following output :
sql:53: ER ROR: operator does not exist: text + integer LINE 1: ...ET Heure_debut = CONCAT(SUBSTRING(Heure_debut,1,2)+12,SUBSTR...
I understand that you cannot add text+integer, but how can i proceed to do that?
Many thanks.
textcolumn to store something like atimeor an interval. If that was atimecolumn, simply adding 12 hours would be as simple asheure_debut + interval '12 hour'- or it might not be necessary at all given your conditionlike '%PM'which sounds as if you are fixing a bad user input that could not have happened if you had chosen the correct data type