Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

SQL DATEDIFF Function Explained

Автор: Ryan & Matt Data Science

Загружено: 2023-05-29

Просмотров: 4810

Описание:

🧠 Don’t miss out! Get FREE access to my Skool community — packed with resources, tools, and support to help you with Data, Machine Learning, and AI Automations! 📈 https://www.skool.com/data-and-ai-aut...

Today we are taking a look at the DateDiff() function within SQL. We go over examples of using it in the Select statement as well as the where clause.


🚀 Hire me for Data Work: https://ryanandmattdatascience.com/da...
👨‍💻 Mentorships: https://ryanandmattdatascience.com/me...
📧 Email: ryannolandata@gmail.com
🌐 Website & Blog: https://ryanandmattdatascience.com/
🖥️ Discord:   / discord  
📚 *Practice SQL & Python Interview Questions: https://stratascratch.com/?via=ryan
📖 *SQL and Python Courses: https://datacamp.pxf.io/XYD7Qg

🍿 WATCH NEXT
SQL Tutorials Playlist:    • SQL Tutorials for Data Analysts  
SQL Stored Procedures:    • SQL Stored Procedures Made Easy: 3 Essenti...  
SQL Rank, Dense Rank, Row Number:    • SQL Rank, Dense Rank, and Row Number Tutor...  
SQL Partition by:    • SQL Partition By Tutorial With Examples!  

In this tutorial, I break down the SQL DATEDIFF function and show you exactly how to use it in both SELECT statements and WHERE clauses for filtering data. The DATEDIFF function is essential for comparing two dates and calculating the time difference between them, whether you need years, months, weeks, days, or even nanoseconds.

I walk through multiple practical examples using a sample database table, demonstrating how to compare dates against the current date using GETDATE(), and how to filter records based on time differences. You'll see real SQL queries in action, including how to find all records from a specific year, calculate month differences, and identify future dates using negative values.

By the end of this video, you'll understand the DATEDIFF syntax completely—including the date type parameter, start date, and end date—and know how to apply it in real-world scenarios like building reports and filtering datasets. This is a function you'll encounter frequently in coding interviews, LeetCode problems, and everyday database work, so it's crucial to master.

Whether you're preparing for SQL interviews or building production reports, this tutorial gives you the foundation you need to work confidently with date calculations in SQL Server.

TIMESTAMPS
00:00 Introduction to Date Diff Function
00:26 Date Diff Syntax and Arguments
01:06 Get Date Function Explained
01:40 Setup: Random Dates Table
02:07 Year Difference Example
03:13 Using Date Diff in Where Clause
04:09 Month Difference Example
04:55 Day and Week Difference Examples

OTHER SOCIALS:
Ryan’s LinkedIn:   / ryan-p-nolan  
Matt’s LinkedIn:   / matt-payne-ceo  
Twitter/X: https://x.com/RyanMattDS

Who is Ryan
Ryan is a Data Scientist at a fintech company, where he focuses on fraud prevention in underwriting and risk. Before that, he worked as a Data Analyst at a tax software company. He holds a degree in Electrical Engineering from UCF.

Who is Matt
Matt is the founder of Width.ai, an AI and Machine Learning agency. Before starting his own company, he was a Machine Learning Engineer at Capital One.

*This is an affiliate program. We receive a small portion of the final sale at no extra cost to you.

SQL DATEDIFF Function Explained

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

How to JOIN 3 TABLES in SQL (2 Examples!)

How to JOIN 3 TABLES in SQL (2 Examples!)

Оконные функции основы | Симулятор SQL | karpov.courses

Оконные функции основы | Симулятор SQL | karpov.courses

SQL tutorial | Date Functions | Difference between DATEDIFF and DATEADD

SQL tutorial | Date Functions | Difference between DATEDIFF and DATEADD

SQL Урок 9 | VIEW Представление SQL | Для Начинающих

SQL Урок 9 | VIEW Представление SQL | Для Начинающих

Working with Dates (SQL) - EXTRACT, DATE_PART, DATE_TRUNC, DATEDIFF

Working with Dates (SQL) - EXTRACT, DATE_PART, DATE_TRUNC, DATEDIFF

Date Functions in SQL | Interview Questions on DATE Functions | DATEPART, DATEADD,DATEDIFF Functions

Date Functions in SQL | Interview Questions on DATE Functions | DATEPART, DATEADD,DATEDIFF Functions

Связи, Case, Isnull, Ifnull, Coalesce - Проще некуда

Связи, Case, Isnull, Ifnull, Coalesce - Проще некуда

SQL Date & Time Functions (Visually Explained) | DATEADD, DATEDIFF, ISDATE | #SQL Course 17

SQL Date & Time Functions (Visually Explained) | DATEADD, DATEDIFF, ISDATE | #SQL Course 17

7 простых приемов, которые мгновенно улучшат ваши SQL-запросы

7 простых приемов, которые мгновенно улучшат ваши SQL-запросы

Solving VERY HARD SQL Interview Questions on Analyst Builder

Solving VERY HARD SQL Interview Questions on Analyst Builder

SQL CTE (общие табличные выражения) — зачем и как их использовать

SQL CTE (общие табличные выражения) — зачем и как их использовать

Вся база SQL для начинающих за 1 час

Вся база SQL для начинающих за 1 час

6 SQL-соединений, которые вы ОБЯЗАТЕЛЬНО должны знать! (Анимация + Практика)

6 SQL-соединений, которые вы ОБЯЗАТЕЛЬНО должны знать! (Анимация + Практика)

How I use SQL as a Data Analyst

How I use SQL as a Data Analyst

SQL Date & Time Functions | DATEPART, DATENAME, DATETRUNC, EOMONTH | #SQL Course 15

SQL Date & Time Functions | DATEPART, DATENAME, DATETRUNC, EOMONTH | #SQL Course 15

Microsoft begs for mercy

Microsoft begs for mercy

Window Functions in MySQL | Intermediate MySQL

Window Functions in MySQL | Intermediate MySQL

Как делать подзапросы в SQL с примерами

Как делать подзапросы в SQL с примерами

Вам нужно изучить SQL ПРЯМО СЕЙЧАС!! (Учебник SQL для начинающих)

Вам нужно изучить SQL ПРЯМО СЕЙЧАС!! (Учебник SQL для начинающих)

SQL Window Functions | Clearly Explained | PARTITION BY, ORDER BY, ROW_NUMBER, RANK, DENSE_RANK

SQL Window Functions | Clearly Explained | PARTITION BY, ORDER BY, ROW_NUMBER, RANK, DENSE_RANK

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com