Fungsi untuk konversi tipe data. Temukan semua 24 fungsi conversion di MySQL lengkap dengan syntax, contoh, dan penjelasan bahasa Indonesia.
24 fungsi conversion di MySQL
← Semua fungsi MySQLConverts a decimal number to its binary string representation. This is shorthand for CONV(num, 10, 2).
VARCHARMengkonversi ekspresi ke tipe BINARY string. Membuat perbandingan string menjadi case-sensitive dan byte-by-byte.
BINARYConverts a BINARY(16) UUID back to its string representation. The inverse of UUID_TO_BIN().
VARCHAR(36)Mengkonversi nilai ke tipe data tertentu. Standar SQL untuk type casting.
Specified typeReturns the connection ID (thread ID) for the current connection.
BIGINT UNSIGNEDConverts a number from one base to another. Supports bases from 2 to 36.
VARCHARMengkonversi nilai ke tipe data atau charset tertentu. Alternatif untuk CAST dengan sintaks berbeda.
Specified typeReturns the name of the currently active (selected) database.
VARCHARFormats a number with thousands separators and a specified number of decimal places. Useful for displaying numbers in a human-readable format.
VARCHARConverts a Unix timestamp to a DATETIME value or a formatted string. The inverse of UNIX_TIMESTAMP().
DATETIME | VARCHARConverts an IPv4 or IPv6 address string to binary format. Supports both IP address formats.
VARBINARY(16)Converts a binary IP address to string format. This is the reverse of INET6_ATON().
VARCHARConverts an IPv4 address string to an unsigned integer. Useful for efficient storage and range-based IP queries.
BIGINT UNSIGNEDConverts an unsigned integer to an IPv4 address string. The inverse of INET_ATON().
VARCHAR(15)Returns the last AUTO_INCREMENT value generated for a column in the current connection.
BIGINT UNSIGNEDConverts a decimal number to its octal string representation. Shorthand for CONV(num, 10, 8).
VARCHARConverts a string to a DATE, DATETIME, or TIME value based on the provided format string. The inverse of DATE_FORMAT.
DATE | DATETIME | TIMEFormats a TIME value into a string according to the specified format. Similar to DATE_FORMAT but designed specifically for time values.
VARCHARReturns the Unix timestamp (seconds since 1970-01-01 00:00:00 UTC). When called with no argument, returns the current Unix timestamp.
BIGINTReturns the username and hostname of the current MySQL connection.
VARCHARGenerates a version 1 Universal Unique Identifier (UUID). The returned value follows the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
VARCHAR(36)Generates a unique 64-bit unsigned integer. Faster and more compact than UUID().
BIGINT UNSIGNEDConverts a UUID string to BINARY(16) format for more efficient storage.
BINARY(16)Returns a string indicating the MySQL server version.
VARCHAR