Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learn SQL using MySQL in One Day and Learn It Well

You're reading from  Learn SQL using MySQL in One Day and Learn It Well

Product type Book
Published in Apr 2024
Publisher Packt
ISBN-13 9781836205678
Pages 121 pages
Edition 1st Edition
Languages
Author (1):
Jamie Chan Jamie Chan
Profile icon Jamie Chan

MySQL Functions

 

The first two functions that we’ll look at are for working with strings.

 

CONCAT()

 

The first is the CONCAT() function. This function allows us to combine two or more strings into a single string. This is known as concatenating the strings.

 

To use the CONCAT() function, we need to provide it with some input. Specifically, we need to tell the function what strings to concatenate.

 

For instance, if we want to concatenate 'Hello' and ' World', we write

 

CONCAT('Hello', ' World');

 

To display the result of this function, we use the SELECT keyword.

 

Besides using the SELECT keyword to select information from tables, we can also use it to display messages.

 

Try running the statement below:

 

SELECT CONCAT('Hello', ' World');

 

You’ll get

 

Hello World

 

as the output.

 

SUBSTRING()

 ...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}