To populate the grid of a view I'm using the database, initially I put the table ID to be the index of the view, however when some record is deleted from the database the index does not become sequential.
So I understand you'd like to have a sequence of 1 to n
not caring for the value of the id
field.
I think it would look something like this:
SELECT
row_number() OVER (ORDER BY id_grupo) AS ROWNUM,
nome
FROM
grupos;
I created a test fiddle: