当前位置:网站首页>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.
边栏推荐
- (redistribute, special comprehensive experiment ospf area)
- [Switch] Protocol-Oriented Programming in Swift: Introduction
- 使命、愿景、价值观到底有什么区别
- WEB 渗透之信息收集
- Introduction to management for technical people 1: What is management
- Summary of Rpc and gRpc Introduction
- Boutique: Taobao/Tmall Get Order Details API for Purchased Products
- OpenFeign实现负载均衡
- flutter 记录学习不一样的动画(一)
- Solve the problem of compiling and installing gdb-10.1 unistd.h:663:3: error: #error “Please include config.h first.”
猜你喜欢

How does the AI intelligent security video platform EasyCVR configure the simultaneous transmission of audio and video?

Organizations Going Online: A New Trend in Organizational Digital Transformation

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

对均匀采样信号进行重采样

小程序毕设作品之微信二手交易小程序毕业设计成品(2)小程序功能

Mini Program Graduation Works WeChat Points Mall Mini Program Graduation Design Finished Work (5) Task Book

Eureka注册中心

WEB 渗透之信息收集

Nacos installation and deployment

Process priority nice
随机推荐
Pytorch框架学习记录3——Transform的使用
传统项目转型
Nacos namespace
解决编译安装gdb-10.1 unistd.h:663:3: error: #error “Please include config.h first.“ 问题
ospf 综合实验(重发布,特殊区域)
MySQ死锁
Small application project works WeChat integral mall small program of graduation design (4) the opening report of finished product
Tcp编程
Mini Program Graduation Works WeChat Points Mall Mini Program Graduation Design Finished Work (5) Task Book
Send it to your friends and let TA treat you to fried chicken!
护网行动基本介绍
[ 云原生之谜 ] 云原生背景 && 定义 && 相关技术详解?
一起来学习flutter 的布局组件
2022.7.29-----leetcode.593
SDL player in action
WEB 渗透之信息收集
逆向分析实战2
小程序毕设作品之微信二手交易小程序毕业设计成品(3)后台功能
AI智能安防视频平台EasyCVR如何配置音视频同时传输?
Tcp programming