FIRST_VALUE and LAST_VALUE : Problem Solving using Analytic Functions

  Рет қаралды 12,633

ORACLE-BASE.com

ORACLE-BASE.com

Күн бұрын

Пікірлер: 17
@keifer7813
@keifer7813 2 жыл бұрын
Fantastic video. Loved the explanation, and demonstrations. This is what you call teaching 👏
@Adam_Marley
@Adam_Marley 3 ай бұрын
Wonderful Video! Thank you for your excellent clarification on this (what I find tricky) topic
@desarai8284
@desarai8284 13 күн бұрын
very grateful for this video. thank you!
@hm.g.2685
@hm.g.2685 4 жыл бұрын
Thanks a lot. In just few minutes I get to understand a very complex topic for me. Really appreciated your efforts.
@gouthamanush
@gouthamanush 5 жыл бұрын
Hi Tim, I didn't understand why the "range between unbounded preceeding and current row" is not applicable for first_value while it is applicable for last value. Could you please explain me that. Thanks.
@oracle-base
@oracle-base 5 жыл бұрын
You can still use the windowing clause, but for FIRST_VALUE is doesn't matter, because it is only ever looking at the first row in the partition, so the window of action only ever really matters about touching the first row. The default windowing clause of RANGE BETWEEN UNBOUNDED PRECEEDING TO CURRENT ROW means FIRST_VALUE always hits the first row. In contrast, LAST_VALUE will not see the last row of the partition unless you explicitly give it a windowing clause.
@gouthamanush
@gouthamanush 5 жыл бұрын
@@oracle-base got you. Thanks for the reply. I bookmarked your website long time ago.. your videos really helped me alot.
@oracle-base
@oracle-base 5 жыл бұрын
"range between unbounded preceeding and current row" is the default windowing clause, so once you user ORDER BY in the analytic clause you get "range between unbounded preceeding and current row" by default, so you don't have to add it or change it. When using LAST_VALUE, you need to see all values in the partition to actually pick up the last value. Unless you open the window to the whole partition, you will be getting the last value of a subset of the partition data.
@camilovega4914
@camilovega4914 3 жыл бұрын
Many thanks for the explanation!!
@BryanSheasby
@BryanSheasby 5 жыл бұрын
I like the video but seeing that is is and it has now been ( - 2006) years since the release of SQL Developer, could you use that for your videos? The main reason being the ability to display the SQL and result in the same window.
@oracle-base
@oracle-base 5 жыл бұрын
This is just a preference thing. SQL Developer is a great development tool, but I don't think is works well visually for videos or presentations. I find it rather distracting, and wasteful of screen space. Of course, some people would not agree with me. :) I tend to do the videos the way I present, which is with SQLcl. I just feel it works better for me. Can't please all the people all the time... :)
@BryanSheasby
@BryanSheasby 5 жыл бұрын
@@oracle-base I understand. I mostly just want to be able to pause the video and see the SQL and the output at the same time.
@oracle-base
@oracle-base 5 жыл бұрын
@@BryanSheasby My solution. Run it twice and pause at two different times. I get double the views. KZbin domination. Muhahaha! Seriously though, most of my videos are based on an article of the same/similar name from my website (links in description). You can pretty much have that open if you like, which shows the query and the result together. In this case: oracle-base.com/articles/misc/first-value-and-last-value-analytic-functions
@SunilKumar-bv9nj
@SunilKumar-bv9nj 4 жыл бұрын
EXCELLENT I 'M GREAT FULL TO YOU
@hm.g.2685
@hm.g.2685 4 жыл бұрын
I would appreciate of you can spare sometime to explain "range between unbounded preceeding and current row" with more complex examples. In case you already did that I appreciate pointing me to such a video.
@oracle-base
@oracle-base 4 жыл бұрын
I explain it in more detail here. oracle-base.com/articles/misc/analytic-functions#windowing_clause
@lakshya209
@lakshya209 3 жыл бұрын
Thanks mate!
SQL Tutorial - Window Functions
12:41
BeardedDev
Рет қаралды 121 М.
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 118 МЛН
УДИВИЛ ВСЕХ СВОИМ УХОДОМ!😳 #shorts
00:49
SIZE DOESN’T MATTER @benjaminjiujitsu
00:46
Natan por Aí
Рет қаралды 3,1 МЛН
Analytic Functions  A Developer’s Best Friend
47:07
Oracle Developers
Рет қаралды 13 М.
AVG, MEDIAN, MIN and MAX : Problem Solving using Analytic Functions
4:01
Analytical Functions in oracle explained with real examples
25:24
How to Read an Execution Plan: Databases for Developers: Performance #1
9:34
SQL performance tuning and query optimization using execution plan
49:23
LAG and LEAD : Problem Solving using Analytic Functions
4:08
ORACLE-BASE.com
Рет қаралды 18 М.
7 Common Excel Mistakes You HAVE to Fix Today!
11:39
MyOnlineTrainingHub
Рет қаралды 21 М.
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 118 МЛН