Sql functions

From wikinotes
Revision as of 18:25, 19 September 2021 by Will (talk | contribs) (Created page with "= Text Functions = <blockquote> == CONCAT == <blockquote> CONCAT lets you combine columns into one <syntaxhighlight lang="MySQL"> SELECT CONCAT(first_name, " ", last_name) AS...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Text Functions

CONCAT

CONCAT lets you combine columns into one

SELECT CONCAT(first_name, " ", last_name) AS fullname FROM users;

SUBSTRING_INDEX

SUBSTRING_INDEX lets you split/tokenize a string

SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2)
##> www.mysql

Number Functions