Number query row in Firebird libreoffice Base

I have a small database created in libreoffice using FIREBIRD as a database engine
It has only one table
the table has three fields
Field 1: ID
Field 2: Planet Name
Field3: Does the planet have a moon or not

This small database has a query to know which planets if they have a satellite or moon

What I want to do with that query is: MODIFY THE CONSULTATION THAT THE ROWS APPEARED TO ME NUMBERED STARTING WITH THE NUMBER ONE, that is to say if there are 5 planets with moons that appear numbered from 1 to 5.

Thank younumber_ query_ rows.odb

Hello,

Use this SQL:

SELECT "Planet", "Moon", ROW_NUMBER() OVER (ORDER BY ID) AS "Row Number" FROM "Planets_And_Moon" WHERE "Moon" = 'Yes'

See more on this in the Firebird documentation found here → Firebird RDBMS. Firebird 2.5 Language Reference (English) - this is latest.