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 SUBSTRING Function

    Overview

    In this tutorial, we will learn MySQL SUBSTRING Function with some examples. This function returns parts of the given string. SUBSTR() function is a synonym for the function SUBSTRING().

    Syntax

    The general syntax of the function is as follows:

    SUBSTRING(<string>,<start_position> [,<length>])

    SUBSTR(<string>,<start_position> [,<length>])

    The function returns the part of the string starting at position start_position and length characters later
    if specified. If the length argument is not specified, the function returns until the end of string.

    Note that the position of the first character in the string from which the substring is to be extracted is 1.

    Examples

    mysql> SELECT SUBSTRING(‘Lionel Messi’,4);
    +—————————–+
    | SUBSTRING(‘Lionel Messi’,4) |
    +—————————–+
    | nel Messi |
    +—————————–+
    1 row in set (0.00 sec)

     

    mysql> — Let’s extract the first character of the footballer

    mysql> SELECT SUBSTRING(‘Lionel Messi’,1,1);
    +——————————-+
    | SUBSTRING(‘Lionel Messi’,1,1) |
    +——————————-+
    | L |
    +——————————-+
    1 row in set (0.00 sec)

     

    MySQL SUBSTRING Function

    —

    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 Architecture› MySQL IN Operator

    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