In the PostGIS SQL Editor, I just want to make a loop to make this function work
This query is to give the UTM Zone number to one column of Global DTM raster table
For Loopid = 0 to 1000, then execute the following statments:
UPDATE public.globaldtm
SET "UTM" = loopid
WHERE rid IN (SELECT rid FROM globaldtm WHERE ST_Intersects(rast,(select geom from utm where gid =loopid)));

How do I write a simple code inside this SQL editor to make the loop work?
TOP 1000would work the same