'How do I change the query so that it inserts only some amount of rows and then deletes them?

I've got a query:

INSERT INTO rates (name, value, time) 
SELECT name, value, now()
FROM updated_rates
ON CONFLICT (name) DO UPDATE
SET value = excluded.value, time = excluded.time;

How do I change the query so that I can select and insert only some number of rows(first 10 or 100, for example) and then delete these rows? There are other columns in the table as well



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source