Home Database Mysql Tutorial mysql常用函数汇总

mysql常用函数汇总

Jun 07, 2016 pm 03:13 PM
linux mysql function Commonly used Summary Community Enter

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 常见的文本处理函数 Left() 返回串左边的字符 Length() 返回串的长度 Locate() 找出串的一个子串 Lower() 将串转换为小写 LTrim() 去掉串左边的空格 Right() 返回串右边的字符 RTrim() 去掉串右边的

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

    常见的文本处理函数

    Left() 返回串左边的字符

    Length() 返回串的长度

    Locate() 找出串的一个子串

    Lower() 将串转换为小写

    LTrim() 去掉串左边的空格

    Right() 返回串右边的字符

    RTrim() 去掉串右边的空格

    Soundex() 返回串的SOUNDEX值

    SubString() 返回子串的字符

    SubString_index() 返回子串字符,substring_index(abcdce,c,1)从第一个c前的所有字符,-1就是之后的字符

    Upper() 将串转换为大写

    日期和时间处理函数

    日期格式:yyyy-mm-dd

    AddDate() 增加一个日期(天、周等)

    AddTime() 增加一个时间(时、分等)

    CurDate() 返回当前日期

    CurTime() 返回当前时间

    Date() 返回日期时间的日期部分

    DateDiff() 计算两个日期之差

    Date_Add() 高度灵活的日期运算函数

    Date_Format() 返回一个格式化的日期或时间串

    Day() 返回一个日期的天数部分

    DayOfWeek() 返回一个日期,返回对应的星期几

    Hour() 返回一个时间的小时部分

    Minute() 返回一个时间的分钟部分

    Month() 返回一个日期的月份部分

    Now() 返回当前日期和时间

    Second() 返回一个时间的秒部分

    Time() 返回一个日期时间的时间部分

    Year() 返回一个日期的年份部分

    数值处理函数

    Abs() 返回一个数的绝对值

    Cos() 返回一个角度的余弦

    Exp() 返回一个数的指数值

    Mod() 返回除操作的余数

    Pi() 返回圆周率

    Rand() 返回一个随机数

    Sin() 返回一个角度的正弦

    Sqrt() 返回一个数的平方根

    Tan() 返回一个角度的正切

    聚集函数:运行在行组上,计算和返回单个值的函数.

    AVG() 返回某列的平均值

    COUNT() 返回某列的行数

    MAX() 返回某列的最大值

    MIN() 返回某列的最小值

    SUM() 返回某列值之和

mysql常用函数汇总

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What computer configuration is required for vscode What computer configuration is required for vscode Apr 15, 2025 pm 09:48 PM

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

How to switch Chinese mode with vscode How to switch Chinese mode with vscode Apr 15, 2025 pm 11:39 PM

VS Code To switch Chinese mode: Open the settings interface (Windows/Linux: Ctrl, macOS: Cmd,) Search for "Editor: Language" settings Select "Chinese" in the drop-down menu Save settings and restart VS Code

vscode Previous Next Shortcut Key vscode Previous Next Shortcut Key Apr 15, 2025 pm 10:51 PM

VS Code One-step/Next step shortcut key usage: One-step (backward): Windows/Linux: Ctrl ←; macOS: Cmd ←Next step (forward): Windows/Linux: Ctrl →; macOS: Cmd →

What is the main purpose of Linux? What is the main purpose of Linux? Apr 16, 2025 am 12:19 AM

The main uses of Linux include: 1. Server operating system, 2. Embedded system, 3. Desktop operating system, 4. Development and testing environment. Linux excels in these areas, providing stability, security and efficient development tools.

How to use VSCode How to use VSCode Apr 15, 2025 pm 11:21 PM

Visual Studio Code (VSCode) is a cross-platform, open source and free code editor developed by Microsoft. It is known for its lightweight, scalability and support for a wide range of programming languages. To install VSCode, please visit the official website to download and run the installer. When using VSCode, you can create new projects, edit code, debug code, navigate projects, expand VSCode, and manage settings. VSCode is available for Windows, macOS, and Linux, supports multiple programming languages ​​and provides various extensions through Marketplace. Its advantages include lightweight, scalability, extensive language support, rich features and version

MySQL's Role: Databases in Web Applications MySQL's Role: Databases in Web Applications Apr 17, 2025 am 12:23 AM

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

vscode setting Chinese tutorial vscode setting Chinese tutorial Apr 15, 2025 pm 11:45 PM

VS Code supports Chinese settings, which can be completed by following the steps: Open the settings panel and search for "locale". Set "locale.language" to "zh-CN" (Simplified Chinese) or "zh-TW" (Traditional Chinese). Save settings and restart VS Code. The settings menu, toolbar, code prompts, and documents will be displayed in Chinese. Other language settings can also be customized, such as file tag format, entry description, and diagnostic process language.

How to type multiple lines of comments in vscode How to type multiple lines of comments in vscode Apr 15, 2025 pm 11:57 PM

VS Code The methods of multi-line commenting are: 1. Shortcut keys (Ctrl K C or Cmd K C); 2. Manually add comment symbols (/ /); 3. Select menu ("Comment Block"); 4. Use extensions; 5. Recursive comments (/* /) and block comments ({/ and /}). Multi-line comments help improve code readability and maintainability, but overuse should be avoided.

See all articles