Here are a couple of options for getting a list of tables in a database in PostgreSQL.
The first option is a psql
command, the second involves querying an information schema view.
Here are a couple of options for getting a list of tables in a database in PostgreSQL.
The first option is a psql
command, the second involves querying an information schema view.
In SQLite, we can use the TIME()
function to subtract one or more hours from a time value.
For datetime values, we can use the DATETIME()
function.
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.
Continue readingIf 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.
Continue readingWhen we have a table with a generated column, here are two methods we can use to return its definition.
Continue readingOracle Database supports the creation of generated columns. A generated column is a column whose value is derived from an expression that computes values from other columns.
In Oracle Database, generated columns are usually referred to as virtual columns. Generated columns can also be referred to as computed columns in other RDBMSs (such as SQL Server). Either way, they do pretty much the same thing – they contain an expression that computes a value based on values in other columns in the same table.
Continue readingMost RDBMSs provide at least a few ways to return rows that contain uppercase characters. Here are some options available in the major RDBMSs.
Continue readingHere’s an example of returning the first day of a given month in Oracle Database. We can return the first day of the current month, a previous or later month, or the first day of a month based on a specified date.
Continue readingHere are two quick and easy options to find out what version of the Redis client (redis-cli
) you’re using.
Here are four quick and easy ways to find out what version of Redis you’re using.
Continue reading