I have table1 on which I do this query
SELECT DATE_FORMAT(FROM_UNIXTIME(t.TSTAMP), "%Y-%m") AS "timePeriod", COUNT(*) AS "prod1"
gives a perfect me 2 column result with col’timePeriod’ and col’prod1′. I would now like to update table2.prod1 where primary key is ‘timePeriod’.
I tried
This will do as you specified