SQL Query | How to find 'n' consecutive days EXCLUDING Weekends | LAG | Windows function | streaks
Вставка
- Опубліковано 16 січ 2025
- In this tutorial, we write a SQL Query using Windows LAG function to find 'n' consecutive date records -
1- including weekends
2 - excluding weekends.
The below tutorial discusses another approach to calculate
n' consecutive days including weekends -
• SQL tutorial | How to ...
The practice data and SQL statements related to this tutorial are available here-
know-star.blog...
Register at the below link to get US $100 off for Coursera Plus membership between Sep 8 - Sep 29, 2022.
The Coursera Plus membership gets you access to unlimited courses and unlimited certifications!
imp.i384100.ne...
How to install SQL Server for practice?
• How to install SQL Ser...
Check out the complete list of SQL Query Interview Questions -
• SQL Query Interview Qu...
Best Data Science / Analytics / SQL courses
Learn SQL Basics for Data Science Specialization
imp.i384100.ne...
Data Science Fundamentals with Python and SQL Specialization
imp.i384100.ne...
Python for Everybody Specialization
imp.i384100.ne...
Google Data Analytics Professional Certificate
imp.i384100.ne...
Coursera Plus - Data Science Career Skills
imp.i384100.ne...
Please do not forget to like, subscribe and share.
For enrolling and enquiries, please contact us at
Website - knowstar.org/
Instagram - / learn.knowstar
Facebook - / knowstartrainings
Linkedin - www.linkedin.c...
Email - learn@knowstar.org
Register at the below link to get US $100 off for Coursera Plus membership between Sep 8 - Sep 29, 2022.
The Coursera Plus membership gets you access to unlimited courses and unlimited certifications!
imp.i384100.net/Ke51on
You explain in such wonderful manner. It makes us so easy to understand for us. Thank you.
Thank you 🙏
simple superb way of explanation. Hats off to you !
Thank you 🙏
Awesome step by step explanation. Thank you so much 👏
Thank you 🙏
Amazing!! I had to do a similar query for student absent 3 consecutive school days and you helped me immensely! Thank u so much!!!
Glad it was helpful 🙏
Wow awesome lecture
Glad it was helpful 🙏
Very well explained
Thank you 🙏
Hi Mam,
Could you please let me know for
How to get the 7days before date from current date excluding weekends dates
hi, am ur new subscriber, am learning sql watching ur videos, thanq so much, and i hav a scenario like write sql query to insert and update the latest records , could u pls explain? thanq.
Glad it was helpful. Here is a tutorial that covers 3 methods to perform the upsert - update and insert operations. Hope it helps.
ua-cam.com/video/3VO1AhrIz8M/v-deo.html
@@LearnatKnowstar thanq so much for the rply, i hav one more scenario, can i?
table A having
col1
A
A
A
B
B
B
B
C
C
D
D
D
D
But output like
col1 col2
A 3
A 3
A 3
B 4
B 4
B 4
B 4
C 2
C 2
D 4
D 4
D 4
D 4
How can i get two columns in output, could u pls explain? thanq.
@@romonivamsi you can try this
select Col1, Count(col1) over (partition by col1) as col2 from table
Love your videos, but please can you slowdown when you are explaining "why" you are choosing a certain function. I feel like I learn a lot from your videos but sometimes why you choose certain strategies is not very clear. If we understand why you do certain functions then we can apply this in our own analysis work.
Thank you for your feedback. Will surely include more explanations on the functions from now on.
How am I supposed to think so critically???
One needs to practice multiple SQL queries. The same tricks will be used in various scenarios.