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 🙂
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!
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?
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.
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?????????????????
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 🙂
Mam what are the topics will be covered?
Awesome explanation of LAG & OFFSET. Thanks!!
Glad it was helpful!
You just saved my semester! Thanks
Thank you
Thanks a lot . Exactly solved the query i was having.
Thank you 🙏
Great Explanation !
thanks sister ! very easy to understand !
Glad it was helpful!
Thanks mam, splendid explanation keep making content like this!!
Thank you Mam ... very useful.. nicely explained ☺️
Thank you so much!
This is amazing helped me alot.
Glad it was helpful.
You're great! Thank you so much
Thank you!
I love watching your content because of the practical examples you use, thank you ❤️
Thank you
@@LearnatKnowstar Thanks maam you are very smart
Great explanation of how window functions work!
Thank you
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
Thanks so much. Do make sure that you and your friends subscribe to the channel 🙂
Thank you so very much!!
Glad it helped!
Nicely explained
Thank you so much 🙂
Good explanation
Thank you
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!
very nicely explained
Thank you so much 🙂
Thank you so much. I needed this! :D
Glad it was helpful.
Good explanation madam...thank you very much.
And mam, what modification is to be done in this query to get the next month sales.??
Thank you. You can use the LEAD function instead of the LAG function
Akka super akka
Excellent video series. Take a bow!! Could you please make something like this in Stored procs, performance tuning concepts
Thanks so much. Sure, we will be posting videos on advanced topics in near future.
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?
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 ....
Hi - this is very helpful. But what if there is a month missing in the last year data ?
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?
Wow!
Can i know the recommended on other customer sql query
Can anyone explain the last scenario month(orderdate)-1 is taken for offset. How is that.
Hi , How about compare day wise sales with previous year day wise sales. ie; compare 29/9/2021 to 29/9/2022
In the offset use year instead of month Lag(sum(sales) , year(orderdate))
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.
use cross join
Write a stored procedure that accepts the month and year as inputs
Please help
Hi everyone,How to find the company that has growth in three successive years.pls provide solution for it
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
I can tell you
tnks !!! I
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?????????????????
There are 897 days in query. How to get results by year months days in same query
why use lag??? what if the data for a few months in a year are absent ???
Yeah that's my issue too
such a ridiculous way of teaching