Here are four options for returning rows that contain uppercase letters in PostgreSQL.
Continue readingTag: how to
How to Format the Month in Roman Numerals in Oracle
Oracle Database provides us with the ability to return the month from a date using roman numerals.
For example, if the month is August, its decimal value would be 08 and it’s roman numeral equivalent would be VIII.
The way to do this is to use the RM
or rm
format element in your format mask. That will format the month using roman numerals in uppercase or lowercase respectively.
Specifying the date format can be done in several places.
Continue reading4 Ways to Find Duplicate Rows in MySQL
If you think a MySQL table might have duplicate rows, you can use the following options to return all duplicates.
Continue readingHow to List All Views in a PostgreSQL Database
In PostgreSQL, we can use the information_schema.views
view to return all views in a database.
We can also use the \dv
psql command to do the same thing.
How to Get Values That Don’t Contain Numbers in MariaDB
When working with MariaDB, you may occasionally find yourself needing to return all rows that don’t contain any numbers.
Technically, numbers can be represented by words and other symbols, but for this article “number” simply means “numerical digit”. So we’re finding values that don’t contain any numerical digits.
Continue reading3 Ways to Return the Modulo in MariaDB
The modulo operation returns the remainder or signed remainder of a division, after one number is divided by another.
If you need to get the modulo of a number in MariaDB, here are three options.
Continue readingHow to Get Multiple Rows into a Comma Separated List in SQL
Most of the major RDBMSs have a function that enables us to return our query results as a comma separated list.
That is, we can use such a function to convert each row into a separate list item, within a comma separated list.
Below are examples of how to achieve this in some of the more popular RDBMSs.
Continue reading3 Ways to Return Rows that Contain Alphanumeric Characters in SQL Server
Here are three examples of returning rows that contain alphanumeric characters in SQL Server.
Alphanumeric characters are alphabetic and numeric characters.
Continue readingDelete Duplicate Rows in SQL Server
The following example uses T-SQL to delete duplicate rows in SQL Server.
To be more specific, it deletes duplicate rows but keeps one. So if you have two identical rows, it deletes one of them and keeps the other. In other words, it de-dupes the table.
Continue readingHow to Return Elements from a JSON Array in MariaDB
MariaDB includes two selectors that enable us to select elements from JSON arrays:
[N]
selects element number N in the array (for example,[0]
to select the first element).[*]
selects all elements in the array.
These can be used in a number of JSON functions that are included in MariaDB. The following examples use them with the JSON_EXTRACT()
function in order to return selected array elements.