please help me delete from the ‘Component’ table all records that have the same ‘country’ and they belong to the same ‘Page’, leave only one record with the country that has the newest createdAt?
Relationship between tables:
Page -> PageComponent.pageId -> PageComponent.componentId -> Component.id
Sandbox with table and data https://www.db-fiddle.com/f/CnFouhFZyfkEpzGKij5eq/2
2
Answers
I found a solution:
I think I am not getting it all but please try this:
Let me know if I have messed up something.