From the course: Advanced SQL – Window Functions
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Defaults, shortcuts, exclusions, and null handling - SQL Tutorial
From the course: Advanced SQL – Window Functions
Defaults, shortcuts, exclusions, and null handling
- [Instructor] The ANSI SQL standard defines shortcuts for frame boundary definitions by omitting the between keyword and one of the boundaries. So, instead of specifying between unbounded preceding and current row, we can just say unbounded preceding and current row will be assumed as the frame and vice versa for unbounded following. Between current row and current row is a legitimate frame. Can you see what is the difference between rows, range and groups current row? Pause the video for a minute and think about it. Rows current row is not very useful. The frame will consist of just the current row and to access expressions from the current row, we don't need window functions to begin with, we can access them directly. Range and groups current row will include the current row and all peer rows that have the same sorting values. These shortcuts may seem like a good idea at first, but I found that saving a few keystrokes may…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.