Skip to content
Advertisement

PostgreSQL query: obtain concise string of numbers

Obtain a concise string of the numbers, for example, given 1,2,3,6,7,8,9,12,14, we expect 1-3,6-9,12,14. Here is the Table: create table tt8 (c1 numeric); insert into tt8 values (1),(2),(3),(6),(7),(8)…

Advertisement