Ask Your Question

number query row in Firebird libreoffice Base

asked 2019-10-24 08:48:01 +0100

marcosAoo gravatar image

updated 2019-10-24 08:48:47 +0100

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 youC:\fakepath\number_ query_ rows.odb

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-10-24 17:37:54 +0100

Ratslinger gravatar image


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.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-10-24 08:48:01 +0100

Seen: 85 times

Last updated: Oct 24 '19