MySQL函数
概述
时间处理等。
函数分类
字符串函数:文本操作 数值函数:数学计算 Time Functions**: Date and time operations / 日期/时间函数:日期和时间操作 聚合函数:数据汇总 控制流函数:逻辑 JSON函数:JSON数据操作 窗口函数:分析计算
字符串函数
基本字符串操作
sql
-- Length
-- Concatenation
-- Substring
-- Position字符串修剪
sql
-- Remove whitespace
-- Remove specific characters字符串大小写
sql
-- Convert case
-- Capitalize (manual)字符串替换
sql
-- Replace text
-- Multiple replacements数值函数
基本数学运算
sql
-- Rounding
-- Absolute value
-- Modulus高级数学
sql
-- Power
-- Square root
-- Random
-- SignTime Functions / 日期/时间函数
Time / 当前日期/时间
sql
-- Current date/time
-- Current date
-- Current time日期提取
sql
-- Extract components日期算术
sql
-- Add/subtract intervals
-- Date difference
-- Complex calculation日期格式化
sql
-- Format date聚合函数
计数函数
sql
-- Count rows
-- Count distinct求和和平均
sql
-- Sum values
-- Average最小和最大
sql
-- Minimum
-- Maximum分组
sql
-- Group by column
-- Multiple grouping控制流函数
IF / IF
sql
-- Simple IF
-- Nested IFCASE / CASE
sql
-- Simple CASE
-- Searched CASEIFNULL和COALESCE
sql
-- IFNULL
-- COALESCE (first non-null)JSON函数
JSON提取
sql
-- Extract values
-- JSON_EXTRACT
-- UnquoteJSON操作
sql
-- Create JSON
-- Modify JSONJSON验证
sql
-- Validate JSON
-- Check type窗口函数
排名函数
sql
-- RANK窗口聚合
sql
-- Running total
-- Moving average实用示例
数据清洗
sql
-- Clean phone numbers
-- Format names数据转换
sql
-- Calculate age
-- Calculate business days数据分析
sql
-- Customer segment
-- Daily statistics小结
MySQL函数提供:
字符串函数:文本操作和格式化 数值函数:数学计算 Time Functions**: Date/time operations / 日期/时间函数:日期/时间操作 聚合函数:数据汇总 控制流:条件逻辑 JSON函数:JSON数据处理 窗口函数:高级分析
使用函数进行高效的数据转换和分析。
上一个:导入数据
下一个:MySQL运算符