1 2 3 4 5 6 … > >>   ∑:1365  Sort:Rank

IF() - Conditional Value Selection
How to conditionally select a value using the IF() function? IF(cond, val1, val2) is a MySQL built-in function that returns the second argument if the first argument is TRUE, the third argument otherwise. The first argument is treated as an integer and evaluated to TRUE if it is not 0. For example: ...
2026-10-24, 2092🔥, 0💬

IFNULL() - Replacing NULL Value
How to substitute a NULL value with a replacement value using the IFNULL() function? IFNULL(val1, val2) is a MySQL built-in function that returns the second argument if the first argument is NULL, the first argument otherwise. For example: SELECT IFNULL(NULL, 'replacement'), IFNULL('original', 'repl...
2026-10-24, 1765🔥, 0💬

INET_ATON() - IP Address String to Number
How to convert an IP address from string format to number using the INET_ATON() function? INET_ATON(ip) is a MySQL built-in function that converts an IP address from string format to number. It uses the following conversion formula: INET_ATON('p 1 .p 2 .p 3 .p 4 ') = INET_ATON(p 1 ×256 3 + p 2 ×256 ...
2026-07-13, 2311🔥, 0💬

GREATEST() - Finding the Greatest/Maximum Value
How to find the greatest (maximum) value of a given list of values using the GREATEST() function? GREATEST(val1, val2, ...) is a MySQL built-in function that returns the greatest (maximum) value of a given list of values. For example: SELECT GREATEST(70, 89, 73, 99, 101, 110, 116, 101, 114); -- +---...
2026-07-13, 2049🔥, 0💬

ISNULL() - Detecting NULL Value
How to detect a NULL value using the ISNULL() function? ISNULL(val) is a MySQL built-in function that returns 1 if the given value is NULL, 0 otherwise. For example: SELECT ISNULL(1+1); -- +-------------+ -- | ISNULL(1+1) | -- +-------------+ -- | 0 | -- +-------------+ SELECT ISNULL(1/0); -- +-----...
2026-07-13, 1807🔥, 0💬

INET_NTOA() - IP Address Number to String
How to convert an IP address from number format to string using the INET_NTOA() function? INET_NTOA(int) is a MySQL built-in function that converts an IP address from number format to string. It uses the following conversion formula: INET_NTOA(int) = 'p 1 .p 2 .p 3 .p 4 ' where: p 1 = (int>&a...
2026-04-13, 2356🔥, 0💬

INET6_ATON() - IPv6 Address String to Number
How to convert an IPv6 address from string format to number using the INET6_ATON() function? INET6_ATON(ip) is a MySQL built-in function that converts an IPv6 address from string format to number. But an IPv6 number is too big to be represented in decimal digits. So it is stored as a byte sequence, ...
2026-04-13, 2102🔥, 0💬

IS_IPV4_MAPPED() - IPv4-Mapped IPv6 Address
How to detect an IPv6 Address that is IPv4 compatible using the IS_IPV4_MAPPED() function? IS_IPV4_MAPPED(ip) is a MySQL built-in function that returns 1 if the given IPv6 address is IPv4-mapped, 0 otherwise. The IPv6 address must be given in number format. An IPv4-mapped IPv6 address has 10 leading...
2026-04-13, 1809🔥, 0💬

MySQL Functions for Miscellaneous Purposes
Where to find reference information and tutorials on MySQL database functions for Miscellaneous Purposes? I want to know how to use CAST(), SLEEP() and other miscellaneous functions. Here is a collection of reference information and tutorials on MySQL database functions for Miscellaneous Purposes co...
2026-03-22, 3301🔥, 0💬

COALESCE() - Finding First Non-NULL Value
How to find the first non-NULL value from a list using the COALESCE() function? COALESCE(val1, val2, ...) is a MySQL built-in function that returns the first non-NULL value from a given list of values. For example: SELECT COALESCE(NULL, 'FYI', NULL, 3.14); -- +----------------------------- ------+--...
2026-03-22, 2171🔥, 0💬

CAST() - Casting Expression to Value
How to cast an expression to a value of the given data type using the CAST() function? CAST(exp AS type) is a MySQL built-in function that casts an expression to a value of the given data type. For example: SET @exp = '-1.99 USD'; SELECT @exp, CAST(@exp AS SIGNED INTEGER), CAST(@exp AS UNSIGNED INTE...
2026-03-22, 1967🔥, 0💬

Differences of DECIMAL and FLOAT in SQL Server
What Are the Differences between DECIMAL and FLOAT in SQL Server Transact-SQL? DECIMAL and FLOAT are both used to store numerical values. But they have the following main differences: DECIMAL(p,s) stores values with the decimal point fixed at the position of s (scale) digits from the right. The tota...
2026-02-12, 3987🔥, 1💬

INET6_NTOA() - IPv6 Address Number to String
How to convert an IPv6 address from number format to string using the INET6_NTOA() function? INET6_NTOA(int) is a MySQL built-in function that converts an IPv6 address from number format to string. For example: SET @ipv6 = UNHEX('FDFE0000000000005A55CAF FFEFA9089');SELECT HEX(@ipv6), INET6_NTOA(@ipv...
2026-02-02, 4196🔥, 0💬

IS_IPV4() - Detecting IPv4 Address
How to detect an IPv4 Address using the IS_IPV4() function? IS_IPV4(ip) is a MySQL built-in function that returns 1 if the given value is a valid IPv4 address, 0 otherwise. For example: SELECT IS_IPV4('10.0.5.9'), IS_IPV4('10.0.5.256'); -- +---------------------+------- ----------------+-- | IS_IPV4...
2026-02-02, 3762🔥, 0💬

IS_IPV4_COMPAT() - IPv4-Compatible IPv6 Address
How to detect an IPv6 Address that is IPv4 compatible using the IS_IPV4_COMPAT() function? IS_IPV4_COMPAT(ip) is a MySQL built-in function that returns 1 if the given IPv6 address is IPv4-compatible, 0 otherwise. The IPv6 address must be given in number format. An IPv4-compatible IPv6 address has 12...
2026-02-02, 3118🔥, 0💬

IS_IPV6() - Detecting IPv6 Address
How to detect an IPv4 Address using the IS_IPV6() function? IS_IPV6(ip) is a MySQL built-in function that returns 1 if the given value is a valid IPv6 address, 0 otherwise. For example: SELECT IS_IPV4('10.0.5.9'), IS_IPV4('10.0.5.256'); -- +---------------------+------- ----------------+-- | IS_IPV4...
2026-01-24, 4476🔥, 0💬

UPDATEXML() - Updating Child Element in XML
How to update a child element in an XML document at a given location using the UPDATEXML() function? UPDATEXML(xml, path, subxml) is a MySQL built-in function that updates a child element in an XML document at a given location. For example: SET @xml = ' X Y '; SELECT UPDATEXML(@xml, '/a', ' Z '); +-...
2026-01-24, 4011🔥, 0💬

CHARSET() - Detecting Character Set Name
How to detect the character set name associated to a given character string using the CHARSET() function? CHARSET(str) is a MySQL built-in function that returns the character set name associated to a given character string. A character set name refers to a set of rules to encode a set of characters ...
2025-10-24, 4061🔥, 0💬

VALUES() - Column Value for "ON DUPLICATE KEY UPDATE"
How to obtain the inserting value of given column in the "ON DUPLICATE KEY UPDATE" clause using the VALUES() function? VALUES(col) is a MySQL built-in function that returns the inserting value of a given column and use it in the "ON DUPLICATE KEY UPDATE" clause. For example: CREATE TABLE MyTable (id...
2025-10-24, 3001🔥, 0💬

COERCIBILITY() - Character Collation Coercibility
How to detect the collation coercibility associated to a given character string using the COERCIBILITY() function? COERCIBILITY(str) is a MySQL built-in function that returns the collation coercibility associated to a given character string. A collation coercibility refers to the coercibility index,...
2025-10-14, 6291🔥, 0💬

COLLATION() - Detecting Character Collation Name
How to detect the character collation name associated to a given character string using the COLLATION() function? COLLATION(str) is a MySQL built-in function that returns the character collation name associated to a given character string. A character collation name refers to a set of rules to sort ...
2025-10-14, 2387🔥, 0💬

What Is Transport Network Substrate in Oracle
What Is Transport Network Substrate (TNS) in Oracle? TNS, Transport Network Substrate, is a foundation technology, built into the Oracle Net foundation layer that works with any standard network transport protocol.   ⇒ What Is ODBC in Oracle ⇐ What Is SQL*Plus in Oracle ⇑ Oracle Database Basic Conc...
2025-09-30, 6806🔥, 1💬

FORMAT_BYTES() - Formatting Bytes in Readable Units
How to format a number of bytes in a human-readable unit using the FORMAT_BYTES() function? FORMAT_BYTES(con) is a MySQL built-in function that converts a number of bytes in a human-readable unit of KiB, MiG, GiB, TiB, PiB or EiB. For example: SELECT FORMAT_BYTES(9), FORMAT_BYTES(9*1024), FORMAT_BYT...
2025-09-24, 5708🔥, 0💬

FORMAT_PICO_TIME() - Formatting Picoseconds in Readable Units
How to format a number of picoseconds in a human-readable unit using the FORMAT_PICO_TIME() function? FORMAT_PICO_TIME(con) is a MySQL built-in function that converts a number of picoseconds in a human-readable unit of ps, ns, ms, s, min, h, or d. For example: SELECT FORMAT_PICO_TIME(9), FORMAT_PICO...
2025-09-24, 2873🔥, 0💬

1 2 3 4 5 6 … > >>   ∑:1365  Sort:Rank