当前位置:网站首页>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'
边栏推荐
- Introduction to spark learning - 1
- Awesome!Coroutines are finally here!Thread is about to be in the past
- 83. Remove Duplicates from Sorted List
- Introduction to the advantages of the new generation mesh network protocol T-Mesh wireless communication technology
- devops-2:Jenkins的使用及Pipeline语法讲解
- 攻防世界----bug
- 甲方不让用开源【监控软件】?大不了我自己写一个
- 建造者模式/生成器模式
- 将 Windows 事件日志错误加载到 SQL 表中
- STM32 GPIO LED和蜂鸣器实现【第四天】
猜你喜欢

世界顶级级架构师编写2580页DDD领域驱动设计笔记,属实有牌面

How to get the 2 d space prior to ViT?UMA & Hong Kong institute of technology & ali SP - ViT, study for visual Transformer 2 d space prior knowledge!.

详谈RDMA技术原理和三种实现方式

甲方不让用开源【监控软件】?大不了我自己写一个

深度学习GPU最全对比,到底谁才是性价比之王?

建造者模式/生成器模式

2021年数据泄露成本报告解读

Spark entry learning-2

为教育插上数字化的翅膀,网易云信发布「互联网+教育」整体解决方案

一文看懂推荐系统:召回03:基于用户的协同过滤(UserCF),要计算用户之间的相似度
随机推荐
vector类
为教育插上数字化的翅膀,网易云信发布「互联网+教育」整体解决方案
Difference and performance comparison between HAL and LL library of STM32
Kubernetes 笔记 / 任务 / 管理集群 / 用 kubeadm 管理集群 / 配置一个 cgroup 驱动
[Unity Getting Started Plan] Basic Concepts (8) - Tile Map TileMap 02
2021年数据泄露成本报告解读
详谈RDMA技术原理和三种实现方式
uniapp隐藏导航栏和横屏显示设置
TCP 可靠吗?为什么?
WordPress 5.2.3 更新,升级出现请求超时的解决方法
Kubernetes 笔记 / 入门 / 生产环境 / 容器运行时
技术干货|如何将 Pulsar 数据快速且无缝接入 Apache Doris
【QT】Qt项目demo:数据在ui界面上显示,鼠标双击可弹窗显示具体信息
Convex Optimization of Optimal Power Flow (OPF) in Microgrids and DC Grids (Matlab Code Implementation)
泰山OFFICE技术讲座:文字边框高度研究
How much do you know about the intelligent operation and maintenance service of data warehouse based on DMS?
基于DMS的数仓智能运维服务,知多少?
ReentrantLock详解
spark入门学习-2
Ruoyi Ruoyi framework @DataScope annotation use and some problems encountered
