UPDATE SUM +1 in decimal value

2

I need to set a UPDATE in a table, however, in the value field: '1481126826.2363343', I need that number to become '1481126826.2363344'

The% w_that I'm trying and the following:

UPDATE callcenter.chamada_agente  
   SET uniqueid = SUM('1481126826.2363343'  + 1)
 WHERE id_chamada_agente  = 32408 
   AND tipo_chamada = 'MANUAL'
   AND datahora_inicio BETWEEN '2016-11-01 00:00:00' AND '2016-12-15 23:59:59';

Can you help me?

    
asked by anonymous 15.12.2016 / 19:39

3 answers

1

Try to use nextval() :

UPDATE callcenter.chamada_agente  
   SET uniqueid = nextval(uniqueid) --> Assim
 WHERE id_chamada_agente  = 32408 
   AND tipo_chamada = 'MANUAL'
   AND datahora_inicio BETWEEN '2016-11-01 00:00:00' AND '2016-12-15 23:59:59';
    
19.07.2017 / 18:55
1

Just add it to yourself:

SET uniqueid = uniqueid  + 1
    
20.07.2017 / 17:03
1

SUM() is an aggregate function, it will not serve what you want. To do this, simply add up the value you want to increment.

UPDATE callcenter.chamada_agente  
   SET uniqueid = uniqueid + 0.0000001 -- uniqueid é o que já tem o valor '1481126826.2363343', certo?
 WHERE id_chamada_agente  = 32408 
   AND tipo_chamada = 'MANUAL'
   AND datahora_inicio BETWEEN '2016-11-01 00:00:00' AND '2016-12-15 23:59:59';
    
20.07.2017 / 18:39