Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть SQL Server Tutorial: Date manipulation

  • DataCamp
  • 2020-03-01
  • 792
SQL Server Tutorial: Date manipulation
SQL TutorialWriting Functions and Stored Procedures in SQL ServerData Science in SQLSQL programmingWriting Functions in SQL ServerStored Procedures in SQL ServerSQL functions for EDATemporal EDADate manipulation in SQL Server
  • ok logo

Скачать SQL Server Tutorial: Date manipulation бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно SQL Server Tutorial: Date manipulation или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

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

Cкачать музыку SQL Server Tutorial: Date manipulation бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео SQL Server Tutorial: Date manipulation

Want to learn more? Take the full course at https://learn.datacamp.com/courses/wr... at your own pace. More than a video, you'll learn hands-on coding & quickly apply skills to your daily work.

---

Now you're ready for more advanced date manipulation. In this lesson, we will introduce GETDATE() and DATEADD(), as well as expand on DATEDIFF() from earlier.

GETDATE() is a great SQL function that returns the current timestamp of the computer's operating system that is running SQL Server. You can use it instead of manually setting date values, which saves you time when executing queries. Your code will also be more consistent and less error-prone. You will use GETDATE() often when writing your own functions and stored procedures.

Here you can see how to select GETDATE() and set a variable to its return value.

DATEADD() is another powerful date function. It adds an integer value to the date passed for the datepart specified. Remember datepart arguments from the beginning of the course? That's how you tell SQL Server which part of the date you'd like to manipulate.

Here we are adding one day to the date value of 2/27/2019.

We can even combine DATEADD() and GETDATE() to select yesterday's date. There is no DATESUBTRACT function in SQL because we don't need it. We can just add negative numbers to get the same effect.

What if we need to know how many passengers were picked up in taxis yesterday? We can use DATEADD() and GETDATE() in the WHERE clause of our SELECT statement. This query will return yesterday's passenger count regardless of the actual date by subtracting one from the value of GETDATE().

Remember DATEDIFF() from earlier? It's a SQL function that counts how many times the datepart boundary specified has been crossed between two dates. That's not always the same as the difference between two dates as we often think about it. The first example shows the day boundary has been crossed once between 2/27/2019 and 2/28/2019, as we would expect.

But have there really been two years between 12/31/2017 and 1/1/2019? No, but the year boundary has been crossed twice. The return value of DATEDIFF() depends on the datepart argument you pass.

Let's find the first day of the current week by using DATEDIFF(), DATEADD(), and GETDATE(). Here we are nesting three SQL functions together. Don't worry, let's break them down individually.

When evaluating nested functions in SQL it can be helpful to start from the innermost function. First, we are calling GETDATE() to return the current date.

Second, we are calling DATEDIFF() to see how many weeks between today and 0, which is equal to 1/1/1900 in SQL Server. It's been 6,217 weeks since 1/1/1900.

By adding zero weeks to the 6,217th week with the DATEADD() function, SQL Server will return the date of the beginning of that week.

Reading and writing nested date functions takes practice, so let's get started.

Комментарии

Информация по комментариям в разработке

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

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]