7 Functions to Format a Number to 2 Decimal Places in MySQL

A common task when working with numbers is to format them to a certain amount of decimal places. Two decimal places seems to be the most common format, but we can format to any number of decimal places we want. MySQL provides us with a number of functions that can help us achieve this.

Below are seven functions that can be used to format a number to two decimal places in MySQL.

Read more

How JSON_OVERLAPS() Works in MySQL

In MySQL, JSON_OVERLAPS() is a function that tests whether or not two JSON documents have any key-value pairs or array elements in common.

The function returns true (1) if the documents have any key-value pairs or array elements in common, and false (0) if they don’t.

The JSON_OVERLAPS() function was added in MySQL 8.0.17.

Read more