MySQL CRC32 Function

MySQL CRC32 function is one of the Mathematical Functions which computes the cyclic redundancy value. The return value of this is 32 bit unsigned integer. The syntax of the CRC32 in MySQL is as shown below:

SELECT CRC32(expression);

This method accepts string expression as an output. If not, it converts the given value into a string.

MySQL CRC32 Function Example

The MySQL CRC32 returns the Cylindric Redundancy value of the given value. The following query shows multiple ways to use this method.

SELECT CRC32('MySQL');

SELECT CRC32('tutorial gateway');

SELECT CRC32('Hello'), CRC32('Hi'), CRC32('World');
MySQL CRC32 Function 1

In this Mathematical method example, we are going to find the Cylindric Redundancy value of Last Name and Occupation columns.

SELECT EmpID, 
       FirstName,
       LastName,
       CRC32(LastName),
       Occupation,
       CRC32(Occupation),
       YearlyIncome,
       Sales
 FROM customer;
MySQL CRC32 Function 2