Here are four options for returning rows that contain uppercase letters in PostgreSQL.
PostgreSQL
How 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.
2 Ways to List all Triggers in a PostgreSQL Database
Here are two options for listing out the triggers in a PostgreSQL database.
Return Just the Numeric Values from a PostgreSQL Database Column
The following PostgreSQL examples return only those rows that have numeric values in a given column.
2 Ways to Return Rows that Contain Only Alphanumeric Characters in PostgreSQL
Below are two methods for returning rows that only contain alphanumeric characters in PostgreSQL.
Alphanumeric characters are alphabetic characters and numeric characters.
How to Show the Current Setting for Null Output in PostgreSQL (psql)
When using psql, null values are returned as an empty string by default.
This can easily be changed with the \pset command, so it could be a value other than the default empty string.
If you’re not sure what your current value is, you can use the show \pset null command to show the current value.
DROP TABLE IF EXISTS Example in PostgreSQL
In PostgreSQL, we can use the IF EXISTS clause of the DROP TABLE statement to check whether the table exists or not before dropping it.
How to Check a Column’s Data Type in SQL
In SQL, the columns information schema view, which returns information about columns, is an ISO standard view that is supported by most of the major RDBMSs. You can use this view to get information about a column’s data type.
Most of the major RDBMs also provide other methods for getting column information.
Here are examples of getting the data type of a column in various SQL databases.
SUM() Function in PostgreSQL
In PostgreSQL, the SUM() function computes the sum of the non-null input values and returns the result.
In other words, it adds numbers and returns the result.