Hi, I've a table of airports where: - idAirport INT NOT NULL AUTO_INCREMENT, - name VARCHAR(100) NULL
In *SQL Server* I use the following query: SELECT * from (SELECT ROW_NUMBER() OVER ( ORDER BY name) AS RowNumber, idAirport FROM Airport) as list where idAirport = 15 and works fine. In *MySQL* OVER(ORDER BY columnName) is not available, so I use this workaround: SELECT * from (SELECT (@row_number:=@row_number + 1) AS RowNumber, idAirport FROM Airport, (SELECT @row_number:=0) AS t ORDER BY name) as list where idAirport = 15 I've tried the same workaround also in *H2*, but the result il always 1 I know that the function OVER(ORDER BY columnName) is in the roadmap, is there a solution in the meantime ?? Thanks -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
