Most major RDBMSs provide ways for us to format numbers using SQL. Some provide only basic formatting capabilities, while others are more advanced.
Below are examples of formatting a number in some of the more popular RDBMSs.
Continue readingMost major RDBMSs provide ways for us to format numbers using SQL. Some provide only basic formatting capabilities, while others are more advanced.
Below are examples of formatting a number in some of the more popular RDBMSs.
Continue readingHere are five ways to check whether or not a table exists in a MySQL database.
Continue readingBelow are two options for returning a full list of stored procedures in MySQL.
Continue readingIn MySQL, the JSON_VALUE()
function extracts a value from a JSON document at the specified path.
The function was introduced in MySQL 8.0.21.
Continue readingBelow are examples of adding a leading zero to a number in SQL, using various DBMSs.
Continue readingIn MySQL, we can format a number as a percentage by concatenating the number with the percent sign.
The CONCAT()
function concatenates its arguments. We can pass the number as the first argument, and the percent sign as the second.
MySQL has a GROUP_CONCAT()
function that enables us to return columns from a query as a delimited list.
It returns a string result with the concatenated non-NULL
values from a group.
Some RDBMSs provide an LPAD()
and RPAD()
function that enables us to left pad or right pad a string. Some functions also allow us to add leading or trailing zeros numbers.
Below are examples of applying SQL padding in some of the more popular RDBMSs.
Continue readingMost of the major RDBMSs provide several options for concatenating two or more strings.
CONCAT()
function, which concatenates its arguments.CONCAT_WS()
that allows you to specify a separator that separates the concatenated strings.Below are examples of each method.
Continue readingMost of the major RDBMSs have functions that enable us to extract the day, month, and year from datetime values.
Some RDBMSs provide multiple ways to do this, and others are more limited. Below are examples of extracting the day, month, and year from date values in some of the most popular RDBMSs.
Continue reading