SQL’s Best Kept Secret: The Window Function rows between clause. #sql

preview_player
Показать описание

In this video, we will talk about rows between clause used in OLAP function in SQL. For window function, you need to define the range of rows to participate in operation. It could be range for partition or ordering of rows in OLAP function.

Some common specifications are:
UNBOUNDED PRECEDING: All rows before current row are considered.
UNBOUNDED FOLLOWING: All rows after the current row are considered.
CURRENT ROW: Range starts or ends at CURRENT ROW.

Below is the link of post referred in this video:

Practice SQL questions on Data Lemur platform.
I will highly recommend to sign up for this platform.
I am sharing my referral link below for easy reference.

Leave a comment if you have any feedback.
Thanks
Raj
Рекомендации по теме
Комментарии
Автор

I am happy to say that I have learned new thing today. The code which you have explained we can write very easily compare than traditional approach. Very well explained. Thank you very much!

surendrag
Автор

I never had stopped to understand this topic but I had to use it last week and I was confused. Thanks for the clear explanation!

DiogoMatsumoto
Автор

Very well explained, I have been looking for a video like this. Thank you !

indudwivedi
Автор

Gone through many videos and articles but your explanation cleared all doubts

beyond_success
Автор

Really amazing all in 1 video very crisp and covered all the combinations. Really Thanks!

HEYTHERE-kowe
Автор

Thanks brother you are life saver. May god bless you.

tariq_mehmood
Автор

you are always telling my current row, how you deciding on current row and in which real time scenario, we use it

priyanshusinha
Автор

That was one close to perfect tutorial for me.

mocococo
Автор

Very well explained, thank you so much!

ngocmainguyen
Автор

Thanks for explaining an advance topic in such an easy way

sobhiksaha
Автор

what if you want the rows to be based on a date? instead of looking back 7 rows look back 7 days which could be 3 rows or it could be 15 rows?

lordcommander
Автор

Hey this was awesome! Great explanations, thanks so much

MrQwerty
Автор

Hello, this is really an amazing video! All that row_number & cte concept has gone.
I have 2 questions :
1. what if I want to fill the data of previous row in my current row and value is in string format not integer.
2. If I want to fill the current row from previous row data but I don't know that exactly row position where data is present (means not null) let's say for large dataset. In this case how to identify which previous row has value.

Thank you so much for explaining this concept Sir.😊
Subscribed ❤

PrakharRajAgrawal
Автор

Will you please explain the difference between range and rows?

ankurranjan
Автор

This is superb!!

I have 2 Questions:

1. How is the performance of this query as compared to our general group by / join / window functions? (I have a data of about 2 billion rows)

2. Also, I have a use case which involves going back 7 days on the basis of a 'date' column (since 1 day can have random number of rows hence cannot use 7 PROCEEDINGS) and doing a sum(amount). Is there a way I can achieve it using this?

BhuvaneshSrivastava
visit shbcf.ru