MySQL String Functions
MySQL Numberic Functions
MySQL
Date
Functions
MySQL Advanced Functions
SELECT
ascii(
left
(customername,1))
as
f01,
char_length(customername)
as
f02,
length(customername)
as
f03,
concat(
"["
,customername,
"]"
)
as
f04,
field(country,
"Germany"
,
"Mexico"
,
"UK"
,
"Sweden"
)
as
f05
/* Germany = 1 */,
format(1000,2)
as
f06 /* 1,000.00 */,
lcase(customername)
as
f07,
mid(customername,2,3)
as
f08 /* abcde = bcd */,
replace
(country,
"Germany"
,
"GM"
)
as
f09 /* same
as
if */,
bin(customerid)
as
f10,
CASE
WHEN
country =
"Germany"
THEN
"GM"
WHEN
country =
"Maxico"
THEN
"MX"
WHEN
country =
"UK"
THEN
"UK"
ELSE
"not found"
END
as
F11,
if(length(customername) > 20,
"Long"
,
"Short"
)
as
f12
FROM
Customers;