Available in versions: Dev (3.19) | Latest (3.18) | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11 | 3.10 | 3.9

MD5

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

The MD5() function calculates the MD5 hash of a given string.

SELECT md5('hello');
create.select(md5("hello")).fetch();

The result being

+----------------------------------+
| md5                              |
+----------------------------------+
| 5d41402abc4b2a76b9719d911017c592 |
+----------------------------------+

Dialect support

This example using jOOQ:

md5("hello")

Translates to the following dialect specific expressions:

-- AURORA_MYSQL, AURORA_POSTGRES, BIGQUERY, COCKROACHDB, DUCKDB, MARIADB, MEMSQL, MYSQL, POSTGRES, SNOWFLAKE, VERTICA, 
-- YUGABYTEDB
md5('hello')

-- EXASOL
hash_md5('hello')

-- ORACLE
lower(standard_hash('hello', 'MD5'))

-- SQLDATAWAREHOUSE
lower(convert(VARCHAR(32), hashbytes('MD5', CAST('hello' AS varchar(8000))), 2))

-- SQLSERVER
lower(convert(VARCHAR(32), hashbytes('MD5', CAST('hello' AS varchar(max))), 2))

-- ACCESS, ASE, DB2, DERBY, FIREBIRD, H2, HANA, HSQLDB, INFORMIX, REDSHIFT, SQLITE, SYBASE, TERADATA, TRINO
/* UNSUPPORTED */

(These are currently generated with jOOQ 3.19, see #10141), or translate your own on our website

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo