当前位置:网站首页>How to extract year, month and day data in date type in SQL Server
How to extract year, month and day data in date type in SQL Server
2022-07-30 03:59:00 【No fish in the water】
I. Brief description
Recently, I encountered a question in the SQL aspect of brushing cattle online, and I encountered a date type that needs to extract the year, month, and day data, so I record the following.The prepared data is as follows, the table name is question_detail.

Second, extract the year, month, and day from the date date type
In SQL, year(column name), month(column name), day(column name), the specific SQL statements are as follows.
SELECTYEAR(DATE) AS "year",MONTH(DATE) AS "month",DAY(DATE) AS "Day"FROMquestion_detail;The execution result is shown in the figure below, which meets our expected requirements.

V. Summary
On paper, it's superficial.Recently, I have realized more and more that seeing it and truly understanding it are two different things. To learn more, you need to do it yourself and experience the mystery.
边栏推荐
- Pytorch framework learning record 2 - the use of TensorBoard
- Tcp编程
- [Driver] udev sets the owner, group and permissions after GPIO is loaded
- 传统项目转型
- golang中如何比较struct,slice,map是否相等以及几种对比方法的区别
- 解决编译安装gdb-10.1 unistd.h:663:3: error: #error “Please include config.h first.“ 问题
- Monitor page deployment
- Gateway routing gateway
- CMake installation and testing
- Nacos Configuration Center
猜你喜欢

forward与redirect的区别

Roperties类配置文件&DOS查看主机网络情况

Mini Program Graduation Works WeChat Points Mall Mini Program Graduation Design Finished Work (7) Interim Inspection Report

Has been empty, a straightforward, continue to copy the top off!

数组和结构体

逆向理论知识3【UI修改篇】

Eureka注册中心

EasyCVR启动时报错“no such file or directory”,该如何解决?

小程序毕设作品之微信积分商城小程序毕业设计成品(6)开题答辩PPT

Organizations Going Online: A New Trend in Organizational Digital Transformation
随机推荐
Eureka Registry
Operational configuration: How to run multiple EasyCVR programs as a service in one server?
小程序毕设作品之微信二手交易小程序毕业设计成品(7)中期检查报告
Has been empty, a straightforward, continue to copy the top off!
mysql structure, index details
AI智能安防视频平台EasyCVR如何配置音视频同时传输?
Sentinel Traffic Guard
WEB 渗透之信息收集
逆向分析实战2
Nacos namespace
Mini Program Graduation Works WeChat Points Mall Mini Program Graduation Design Finished Work (5) Task Book
Mini Program Graduation Works WeChat Second-hand Trading Mini Program Graduation Design Finished Works (4) Opening Report
OpenFeign realize load balance
flutter 记录学习不一样的动画(一)
day10--install mysql on linux
弘玑再度入围Gartner 2022 RPA魔力象限并实现位置大幅跃升
Mini Program Graduation Works WeChat Second-hand Trading Mini Program Graduation Design Finished Works (3) Background Functions
forward与redirect的区别
数组和结构体
Redis "super explanation!!!!!!"