I have a table like this:
p_id | store | createdat | device | deviceserial | application ------+-------+---------------------+---------+--------------+