Skip to main content

All Questions

Filter by
Sorted by
Tagged with
14 votes
2 answers
11k views

Select longest continuous sequence

I am trying to construct a query in PostgreSQL 9.0 that gets the longest sequence of continuous rows for a specific column. Consider the following table: lap_id (serial), lap_no (int), car_type (...
DaveB's user avatar
  • 319