SUBSTRING Function - How to use SUBSTRING Function in MySQL

SUBSTRING Function - How to use SUBSTRING Function in MySQL


SUBSTRING Function in MySQL is used to extract a substring from a position with specific position.

Syntax:


SUBSTRING(string,position);
SUBSTRING(string,position,length);



So in below example if we want to start from 3rd characters and returned the rest of rows we can do that. In second part of select we are specificity telling start from 4th characters but only returned 4 records from 4th position.


Select substring('My Test string',3),
substring('My Test string',4,4) from customer;


How to use SUBSTRING Function in MySQL - MySQL Tutorial

1 comment:

  1. Telangana Board Model Paper 2023 Class 3 Pdf Download with Answers for Telugu Medium, English Medium, Hindi Medium, Urdu Medium & Students for Small Answers, Long Answer, Very Long Answer Questions, and Essay Type Questions to Term1 & Term2 Exams at official website. Telangana Board Question Paper Class 3 New Exam Scheme or Question Pattern for Sammittive Assignment Exams (SA1 & SA2): Very Long Answer (VLA), Long Answer (LA), Small Answer (SA), Very Small Answer (VSA), Single Answer, Multiple Choice and etc.

    ReplyDelete