Postgresql – How can I remove duplicate id's based on the earliest datetime and then find the intersection of this list and another based on the same datetime?
So I have the following query select * from sval where fid = 4044 and val = 'True'; The output of the above is: sval table id fid timestamp val 1 4044 2019-01-22 00:00:00.000 True 2 4044 2020-02-22 00:00:00.000 True…