Search Postgresql Archives

Casting int to bool with join...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am trying to update rows in a new table and re-cast to boolean at the same time. I am absolutely certain that the integers are 0 or 1. Is there a one line way to do this?

UPDATE app_id_800 SET cal_byte_w_err = cal_byte_w_err.value::boolean
FROM cal_byte_w_err
WHERE app_id_800.timestamp BETWEEN '2004-01-01 00:00:00' AND '2004-01-01 00:00:05'
AND app_id_800.timestamp = cal_byte_w_err.timestamp;


Many thanks... I've spent way too long trying to figure this out :(

Cheers,
Randall


---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux