【MySQL】内置函数

一、日期函数

mysql> select current_date();

+----------------+

| current_date() |

+----------------+

| 2026-03-09 |

+----------------+

1 row in set (0.00 sec)

mysql> select current_time();

+----------------+

| current_time() |

+----------------+

| 20:29:22 |

+----------------+

1 row in set (0.00 sec)

mysql> select current_timestamp();

+---------------------+

| current_timestamp() |

+---------------------+

| 2026-03-09 20:29:36 |

+---------------------+

1 row in set (0.00 sec)

mysql> select current_now();

ERROR 1305 (42000): FUNCTION bit_index.current_now does not exist
mysql> select now();

+---------------------+

| now() |

+---------------------+

| 2026-03-09 20:29:57 |

+---------------------+

1 row in set (0.00 sec)

mysql> select date(now());

+-------------+

| date(now()) |

+-------------+

| 2026-03-09 |

+-------------+

1 row in set (0.00 sec)

二、字符串函数

mysql> select length('ABSF23afji');

+----------------------+

| length('ABSF23afji') |

+----------------------+

| 10 |

+----------------------+

1 row in set (0.00 sec)

三、数学函数

四、其他函数

相关推荐
素材积累2 小时前
博士后出站来深可申请的项目补贴等
数据库
_1_73 小时前
SQL Server 磁盘满了 收缩日志
数据库·sqlserver
basketball6164 小时前
Redis基础:1. Redis介绍
数据库·redis·缓存
李可以量化4 小时前
成交量的终极量化策略:价量共振指标完整实现(下篇)
前端·数据库·人工智能
汽车仪器仪表相关领域5 小时前
南华 NHAT-610 柴油车排放测试仪 产品详解
数据库·功能测试·汽车·压力测试·可用性测试
我滴老baby6 小时前
工业时序数据实战:基于 DolphinDB 流计算引擎的实现与调优
数据库
睡不醒男孩0308237 小时前
TiDB数据库调研
数据库·tidb
珠***格7 小时前
实操落地|防逆流装置的安装规范、调试标准与故障处置
网络·数据库·人工智能·分布式·能源·边缘计算
Omics Pro8 小时前
3种蛋白结构输入方式!已申报欧洲发明专利
数据库·人工智能·python·机器学习·plotly
itfallrain8 小时前
Spring 构造器循环依赖排查:@RequiredArgsConstructor + @Lazy 到底有没有生效
数据库·python·spring