0

I want to get a row per ten rows,for a example,I define a table as below,

 t=table(1..1000 as id, rand(1.0, 1000) as value)

Then I want to get the rows where id%10 is 1. How to write this sql statement?

Wale
  • 1
  • 8

1 Answers1

0

Try this sql:

select * from t where rowNo(id) % 10 = 0

The function rowNo returns the index position of each row in a table.

Summer.H
  • 99
  • 1
  • 7