Working with Strings in MySQL (four functions)

preview_player
Показать описание
Watch Ben cover 4 string functions in MySQL, including CONCAT, SUBSTRING_INDEX, LOCATE, and SOUNDEX.

The CONCAT function allows you to concatenate strings together! This is nothing new for an experienced programmer, but this function can come in handy in many scenarios in MySQL.

SUBSTRING_INDEX can be used to grab substrings based on the number of occurrences of a token. This is useful when doing processing with things like, paths, URLs, or CSV data.

LOCATE allows you to locate the index of one string within another! This can help as a way to put additional sorting or constraints on searches.

Finally, the SOUNDEX function produces strings representing the sound of a work in spoken English. It's a bit of a niche function, but there are a few contexts where knowing this may be useful!

💬 Follow PlanetScale on social media
Рекомендации по теме
Комментарии
Автор

I like the monitor angle you used for that one :) Nice illusion of you looking at the content we see at that place

Pakuna
Автор

Guys, please post a video on isolation levels and how to choose between them

ValarpiraiA
Автор

Perfect timing for such video nice!! Thx sharing more and more updated MySQL/Vitess content

otmanm
Автор

CONCAT_WS() can be useful too when we know how to separate our input strings
I used SOUNDEX() with MSSQL in the past to extract some records with misspelled word or a word/name with tiny spelling variation,
For example the following returns the same value for all of the name spelling variation:
SELECT SOUNDEX('Ahmad'), SOUNDEX('Ahmed'), SOUNDEX('Ahmet')

Thanks Ben!

ahmad-murery
Автор

there is so much i dont know about mysql, thanks

devperatetechno
Автор

I would use LIKE '%computer%' to search for a string inside another one. I need to check but I would assume it's faster as well

clementmmas