TestingDocs.com
    Software Testing website
    • Automation
      • Selenium
      • JBehave Framework
    • Tutorials
      • MySQL Tutorials
      • Testlink
      • Maven
      • Git
    • IDEs
      • IntelliJ IDEA
      • Eclipse
    • Flowcharts
      • Flowgorithm
      • Raptor
    • About

    MySQL

    MySQL Functions

    Overview

    MySQL Functions can be invoked within expressions and returns a value that is used in place of the function call when the expression is evaluated.

    Syntax

    The general the syntax for a MySQL Function call includes the function name followed by parenthesis
    optional argument:

    function_name(<arg1>[, <arg2>,…,<argn>])

    Spaces around function arguments are permitted. However, by default there must be no white-space between a function name and the parenthesis following it. This helps the MySQL Parser distinguish between function calls and references to tables or columns that happen to have the same name as a function.

    Functions in MySQL Expressions

    A function call is a value expression, and can thus appear anywhere where a value expression is accepted. Columns are also perfectly fine to use as arguments as long as they are in the correct data type. A function’s output can also be the input to another MySQL function.

    An expression that contains NULL always produces a NULL value unless otherwise indicated in the documentation for a particular function or operator. Mathematical functions will return NULL on error ( for example; division by zero)

    mysql> SELECT 1/0;
    +——+
    | 1/0 |
    +——+
    | NULL |
    +——+
    1 row in set (0.00 sec)

    Examples

    The following are examples of simple functions within a SELECT statement:

    NOW()

    The NOW function returns the current date/time.

    VERSION()

    The VERSION function returns the MySQL version currently being used on the database server host.

     

    MySQL Functions Example

    Numeric Functions

    https://www.testingdocs.com/mysql-mathematical-functions/

    String Functions

    https://www.testingdocs.com/mysql-string-functions/

    Temporal Functions

    https://www.testingdocs.com/mysql-temporal-functions/

    —

    MySQL Tutorials

    MySQL Tutorials on this website:

    https://www.testingdocs.com/mysql-tutorials-for-beginners/

    For more information on MySQL Database:

    https://www.mysql.com/

    Related Posts

    Stellar Converter for Database Tool

    MySQL /

    Stellar Converter for Database

    Stellar MySQL Log Analyzer

    MySQL /

    Stellar Log Analyzer for MySQL

    Stellar Repair for MySQL

    MySQL /

    Stellar Repair for MySQL

    MySQL /

    How to secure your SQL Database: Tips and Tricks

    Stellar Converter for Database

    MySQL /

    Database Converter Tools

    ‹ MySQL MODIFY COLUMN clause› MySQL ADD INDEX Statement

    Recent Posts

    • ChatGPT Plans Free and PlusChatGPT Subscription Plans
    • Stellar Converter for Database ToolStellar Converter for Database
    • Stellar MySQL Log AnalyzerStellar Log Analyzer for MySQL
    • Stellar Repair for MySQLStellar Repair for MySQL
    • ChatGPT IntroductionChatGPT Capabilities
    • How to secure your SQL Database: Tips and Tricks
    • ChatGPT4 Conversational AI FeaturesChatGPT4 Conversational AI Features
    • Trends in Software EngineeringShaping the Future of Development: Exploring Key Trends in Software Engineering
    • Java PerformanceImproving Java Performance with Multithreading
    • QDrant Vector DatabaseOpen-source Vector Databases
    • Difference between PHP and JavaScript?
    • Bing AI Browser Web ContentBing Conversation Styles
    • ChatGPT PreviewChatGPT Introduction
    • Open Source AI Frameworks TensorFlowOpen Source AI Frameworks
    • Artificial Intelligence Tools

    Back to Top

    Links

    • Contact
    • Privacy Policy
    • Cookie Policy

    www.TestingDocs.com