Update one table based on highest record value in another table in postgreSQL
I have two tables (see below) in a postgreSQL database. Table1 tracks all changes made to each ID (i.e. multiple rows per ID): create table table1(id,record,name,data1,data2,data3)as values (1,1,'Dave', 1.2,55,1) ,(1,2,'David', 1.2,55,1) ,(2,1,'Sam', .8,30,2) ,(3,1,'Jenn', .9,28,2) ,(4,1,'Arthur',1.1,77,1) ,(5,1,'Jim', .7,42,2) ,(5,2,'Jimmy', .7,42,2)…