MYSQL Pocket reference

Page 102

BIT_COUNT(number)

Returns the number of bits that are set to 1 in the binary representation of the number (e.g., BIT_ COUNT(17) returns 2). BIT_LENGTH(string)

Returns the number of bits in string (the number of characters times 8, for single-byte characters). CASE value WHEN choice THEN returnvalue ... ELSE returnvalue END Compares value to a series of choice values or expressions. The first choice to match the value ends the function and returns the corresponding returnvalue. The ELSE returnvalue is returned if no choice matches. CAST(expression AS type) Casts the expression into the SQL type noted by type. CEILING(number)

Returns the smallest integer greater than or equal to number (e.g., CEILING (5.67) returns 6). CHAR(num1[,num2,. . .])

Returns a string made from converting each number to the character corresponding to that ASCII value (e.g., CHAR(122) returns Z). CHAR_LENGTH(string)

Provides the length of a string in characters. CHARACTER_LENGTH(string)

Provides the length of a string in characters. CHARSET(expression)

Provides the character set of the string expression. COALESCE(expr1, expr2, ...) Returns the first non-NULL expression in the list (e.g., COALESCE(NULL, NULL, 'cheese', 2) returns cheese).

Functions |

95


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.