I have a table as below:
WITH table1 AS ( SELECT TIMESTAMP \'2016-10-18 2:51:45\' AS ts, \'AB4\' AS packId, FALSE AS stat, \'x\' AS positi