当前位置:网站首页>SQL中对 datetime 类型操作
SQL中对 datetime 类型操作
2022-08-03 16:05:00 【威威沁沁】
datetime 是SQL中 表示时间的类型
下面,我将演示几种插入 datetime 类型的数据
先创建一个test 表,定义表中记录为 datetime 类型
create table test(t datetime);1、插入 now()
now 是 SQL 内置函数,可以获取当前时间
insert into test values(now());
2、插入指定时间
如果我们想插入指定时间的话需要按照格式进行插入,而SQL中时间格式有很多,这次主要介绍标准格式。
标准时间格式:'YYYY-MM-DD HH:mm:ss'
例:'2022-08-01 12:00:00'
边栏推荐
- 攻防世界----bug
- STM32 GPIO LED and buzzer implementation [Day 4]
- "Avnet Embedded Weekly" Issue 276: 2022.07.25--2022.07.31
- [Unity Getting Started Plan] Basic Concepts (8) - Tile Map TileMap 02
- uniapp的webview滑动缩放
- 泰山OFFICE技术讲座:文字边框高度研究
- Kubernetes 笔记 / 入门 / 生产环境 / 用部署工具安装 Kubernetes / 用 kubeadm 启动集群 / 安装 kubeadm
- 面了个腾讯35k出来的,他让我见识到什么叫精通MySQL调优
- vector类
- MySQL性能优化_小表驱动大表
猜你喜欢
随机推荐
【Unity入门计划】制作RubyAdventure01-玩家的创建&移动
5 v 8.4 v1A charging current charging management IC
Common distributed theories (CAP, BASE) and consensus protocols (Gosssip, Raft)
从零开始搭建MySQL主从复制架构
扩展欧几里得求逆元实例
泰山OFFICE技术讲座:文字边框高度研究
leetcode SVM
13 and OOM simulation
JD6606SP5_JD6606SSP_JD6606SASP_JD6621W7百盛新纪元授权代理商
spark入门学习-1
请问大家,MySQL全量怎么样可以提高性能呢?我这里瓶颈是在Source上,在不增加并行度的情况下,
QT QT 】 【 to have developed a good program for packaging into a dynamic library
如何选择合适的导电滑环型号
mysql delete execution error: You can't specify target table 'doctor_info' for update in FROM clause
MarkDown常用代码片段和工具
Interpretation of the 2021 Cost of Data Breach Report
AI+BI+Visualization, Deep Analysis of Sugar BI Architecture
unity用代码生成LightProbeGroup
技术干货|如何将 Pulsar 数据快速且无缝接入 Apache Doris
leetcode-268.丢失的数字









