Run Code

Code Wall

Users

Misc

Feedback

About

Login

Theme
Select rows only with values separated by a given interval from other ...
with recursive t(x) as ( select * from unnest('{11,14,18,20,25,39,42,43,50,55,60,61,69,70,71}'::int[]) order by random()), r(x) as ( select min(x) as x from t union all (select t.x from t join r on (t.x >= r.x + 10) order by t.x limit 1)) select * from r;
run

edit

history

help
0
Please
log in
to post a comment.
Postgres Practice
FInale 38474297439
Limit & union
Return IDs where there are exactly 3 occurrences
Select all countries that can be found by recursively adding all neighbouring countries (PostgreSQL)
finale47394372
Conditional Cross Join  Why doesn't this work on the 'ON' clause?
Return IDs where there are exactly 3 occurrences1
Update as a function result
PostgreSQL aggregate JSON recordset keys by row
Please log in to post a comment.