4 ms·
I've been using SQL for 24 years and don't think I've ever used BETWEEN ROW before. Did read up on it now, though.
by JohnTHaller 7y ago
I've been using SQL for 24 years and don't think I've ever used BETWEEN ROW before. Did read up on it now, though.
- psaux 7y agoI wrote sql for years for a forex platform used by some of the top dogs (literal). Pretty hardcore sql and had to be very fast, never used BETWEEN ROW.
- roel_v 7y agoWhat breeds of dogs use forex platforms?
- guywhocodes 7y agoFiat Retrievers
- thom 7y agoI use it all the time, both in ad hoc queries and in data prep for models. Most commonly just to look into a future window from the current event (i.e. did this pass in a game of soccer lead to a shot etc). It's quite rare that I'll specifically care about X rows preceding or following but it does happen that you care about a shorter period than the entire window. Entirely possible people are using graph databases for that sort of thing, but the window syntax is nice.
- markus_zhang 7y agoI have to use it quite often because the dialect I'm using defaults on BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW which I have to manually change to BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING.
- nogabebop23 7y agoThere are so many specialized aspects that you'll never use outside of an interview or an edge case when you can learn it on-demand.