Here are five ways to see whether a table contains a generated column in MariaDB.
MariaDB
How to Create a Generated Column in MariaDB
A generated column is a database column whose value is an expression. Therefore, the value of the generated column is usually derived (for example, it could be derived from values in other columns).
Generated columns are also sometimes referred to as computed columns or virtual columns.
Creating a generated column in MariaDB is essentially the same as creating a normal column. The difference is that the definition of the generated column contains an expression that determines the column’s value.
How to Delete Duplicate Rows that have a Primary Key in SQL
The following examples use SQL to delete duplicate rows that have a primary key or unique identifier column.
Specifically, the examples delete all duplicates except one. So for example, in the case of three identical rows, it deletes two of them and keeps one.
3 Ways to Get the Start of the Month in MariaDB
Here are three options for returning the first day of a month in MariaDB.
This could be the first day of the current month, or the first day of the month based on a date that we specify.
Return Only Numeric Values in SQL
If you ever need to use SQL to return just the numeric values in a character column, the method you use will largely depend on your DBMS. Most DBMSs support regular expressions (regex), but some don’t. And some include functions that can detect numeric values.
Here are examples of how to do it in the more popular DBMSs.
MariaDB CASE Statement
In MariaDB, the CASE statement can be used in stored programs to perform a complex conditional construct. It compares a list of conditions and returns a different result depending on which condition (if any) is matched.
The CASE statement is distinct from the CASE operator, in that the CASE statement is specifically for use in stored programs. Also, there’s a slight difference in the syntax.