SQL Query | Compare monthly sales with previous month, same month previous year, first month of year

  Рет қаралды 51,770

Learn at Knowstar

Learn at Knowstar

Күн бұрын

Пікірлер: 64
@LearnatKnowstar
@LearnatKnowstar 3 жыл бұрын
Are you interested in attending an online SQL training course? We have received a few inquiries and are now planning one on 18 and 19 September 2021. This will be a 10 hours instructor led training covering SQL concepts as well as practical SQL query writing. The training cost is USD 100. If you are interested, please register here - forms.gle/y2U2eKmShq6JUnc29 Thank you 🙂
@mihirforyou3531
@mihirforyou3531 3 жыл бұрын
Mam what are the topics will be covered?
@jashanpreetsingh4750
@jashanpreetsingh4750 2 жыл бұрын
Thanks a lot . Exactly solved the query i was having.
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
Thank you 🙏
@tlubaina
@tlubaina 3 жыл бұрын
You just saved my semester! Thanks
@LearnatKnowstar
@LearnatKnowstar 3 жыл бұрын
Thank you
@surajpatil3579
@surajpatil3579 3 жыл бұрын
Thanks mam, splendid explanation keep making content like this!!
@saktibiswal6445
@saktibiswal6445 Жыл бұрын
Awesome explanation of LAG & OFFSET. Thanks!!
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Glad it was helpful!
@chandudevarapu1578
@chandudevarapu1578 3 жыл бұрын
Thank you mam... Nice explained pls upload more videos like that... I will refer my friends also this type of scenarios very useful for us
@LearnatKnowstar
@LearnatKnowstar 3 жыл бұрын
Thanks so much. Do make sure that you and your friends subscribe to the channel 🙂
@mihirforyou3531
@mihirforyou3531 3 жыл бұрын
Thank you Mam ... very useful.. nicely explained ☺️
@LearnatKnowstar
@LearnatKnowstar 3 жыл бұрын
Thank you so much!
@mummz3371
@mummz3371 2 жыл бұрын
I love watching your content because of the practical examples you use, thank you ❤️
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
Thank you
@MokshDrar
@MokshDrar Жыл бұрын
@@LearnatKnowstar Thanks maam you are very smart
@NareskanthM
@NareskanthM 5 ай бұрын
Great Explanation !
@NareskanthM
@NareskanthM 4 ай бұрын
thanks sister ! very easy to understand !
@LearnatKnowstar
@LearnatKnowstar 4 ай бұрын
Glad it was helpful!
@Regc10
@Regc10 Жыл бұрын
This is amazing helped me alot.
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Glad it was helpful.
@nikolaybaranov2213
@nikolaybaranov2213 2 жыл бұрын
Great explanation of how window functions work!
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
Thank you
@thatssodinesh7857
@thatssodinesh7857 Жыл бұрын
You're great! Thank you so much
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Thank you!
@brianducharme3418
@brianducharme3418 3 жыл бұрын
Thank you so very much!!
@LearnatKnowstar
@LearnatKnowstar 3 жыл бұрын
Glad it helped!
@pupu41784
@pupu41784 2 жыл бұрын
Thank you so much. I needed this! :D
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
Glad it was helpful.
@deepthimurali962
@deepthimurali962 Жыл бұрын
Can you suggest how to use lag and offset if we want to compare Jan-Feb 2022 vs Jan-Feb 2023. I basically want to sum both jan and feb and compare the growth Thanks for this!
@pravinm1490
@pravinm1490 Жыл бұрын
Nicely explained
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Thank you so much 🙂
@mmohan692
@mmohan692 2 ай бұрын
Akka super akka
@pravinm1490
@pravinm1490 Жыл бұрын
very nicely explained
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Thank you so much 🙂
@ajeshrajan8079
@ajeshrajan8079 Жыл бұрын
Good explanation
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Thank you
@Tech2BI
@Tech2BI 3 жыл бұрын
As long as it's 2017 or higher versions we have functions for the same scenarios for previous versions like 2012 or 2008 r2 do you have any solution for this?
@Hello.1253-e8v
@Hello.1253-e8v 3 жыл бұрын
Excellent video series. Take a bow!! Could you please make something like this in Stored procs, performance tuning concepts
@LearnatKnowstar
@LearnatKnowstar 3 жыл бұрын
Thanks so much. Sure, we will be posting videos on advanced topics in near future.
@jadeldeek5100
@jadeldeek5100 2 жыл бұрын
is possible to have monthly figures or yearly figures by columns not by row as your example? YEAR 1, YEAR 2 OR JAN, FEB , MARS ....
@kesavanandt1195
@kesavanandt1195 2 жыл бұрын
Good explanation madam...thank you very much. And mam, what modification is to be done in this query to get the next month sales.??
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
Thank you. You can use the LEAD function instead of the LAG function
@oladman9058
@oladman9058 Жыл бұрын
Wow!
@jonnybrooks97
@jonnybrooks97 Жыл бұрын
How can you drill down into specific columns with this, for example if you wanted to look at month on month changes for each store or region?
@satyapalrawat7857
@satyapalrawat7857 Жыл бұрын
Hi - this is very helpful. But what if there is a month missing in the last year data ?
@arfathth5176
@arfathth5176 2 жыл бұрын
Can i know the recommended on other customer sql query
@ankurranjan3218
@ankurranjan3218 2 жыл бұрын
Let suppose Data does not have consecutive months data. For example I am having 2020-01 and 2020-06 data only then If I am comparing with previous month using LAG then it will not be correct, right? As it will compare June from Jan but I wanted to compare only June from May. How to proceed for this type of scenrio.
@pranavnair8977
@pranavnair8977 2 жыл бұрын
use cross join
@vinaymaddi4801
@vinaymaddi4801 2 жыл бұрын
Can anyone explain the last scenario month(orderdate)-1 is taken for offset. How is that.
@vinayv1940
@vinayv1940 2 жыл бұрын
Hi , How about compare day wise sales with previous year day wise sales. ie; compare 29/9/2021 to 29/9/2022
@pradeepvaka2545
@pradeepvaka2545 2 жыл бұрын
In the offset use year instead of month Lag(sum(sales) , year(orderdate))
@rohitwaregaonkar3703
@rohitwaregaonkar3703 Жыл бұрын
Write a stored procedure that accepts the month and year as inputs Please help
@balamuralibattala3283
@balamuralibattala3283 Жыл бұрын
Hi everyone,How to find the company that has growth in three successive years.pls provide solution for it
@gowthamev8745
@gowthamev8745 3 жыл бұрын
How to calculate interview in sql for example:- customer placed an order, we have to find the customer who placed an order more than 1 within 7 days
@gelectiusdroid4147
@gelectiusdroid4147 2 жыл бұрын
I can tell you
@gmocore
@gmocore 2 жыл бұрын
tnks !!! I
@sivachaitanya6330
@sivachaitanya6330 Жыл бұрын
month(date) inside lag() function is throwing error says month should not be here in mysql ................what is the solution.........lag(sum(amount),Month(date))-------------->ERRor?????????????????
@advancewebdevelopment9802
@advancewebdevelopment9802 2 жыл бұрын
There are 897 days in query. How to get results by year months days in same query
@ganeshkharad
@ganeshkharad 2 жыл бұрын
why use lag??? what if the data for a few months in a year are absent ???
@RAJUBHAI-ww7em
@RAJUBHAI-ww7em Жыл бұрын
Yeah that's my issue too
@smritichauhan6006
@smritichauhan6006 11 ай бұрын
such a ridiculous way of teaching
SQL Query | How to calculate YTD and MTD totals | Window Functions
16:01
Learn at Knowstar
Рет қаралды 43 М.
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 43 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 103 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 97 МЛН
SQL Tutorial - Compare Current Row and Previous Row
7:37
Absent Data
Рет қаралды 11 М.
6 SQL Joins you MUST know! (Animated + Practice)
9:47
Anton Putra
Рет қаралды 214 М.
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 43 МЛН