Sometimes we want to send an email when something suspicious happens in a database. Oracle is able to natively send emails.
How to aggregate data that match a given condition. How to perform different aggregations of data that match different conditions, in a single query. Includes convenient SQLite shortcuts.
How to select text values that contain HTML tags. How to disallow inserting texts that contain HTML tags.
Getting a list of unique values from a column is easy. But if the same type of values are written on multiple columns and we want to eliminate duplicates, this requires a little trick.
Sometimes we want to send an email when something suspicious happens in a database. SQL Server is able to natively send emails.
There is some confusion about the
FOR EACH, the
MODE, and the
AFTER clauses of Db2
CREATE TRIGGER. While other clauses are common to most DBMSs,
MODE is a Db2 unique feature. Their meaning is simpler than it seems.
How to find rows that contain, or don’t contain, a value from a list. The list may be written in the query, or stored in a table.
SELECT rows from table A that have, or don’t have, a match in table B. While doing this, we’ll keep performance in mind.
How to get the length of the longest text in a column. Including Db2 specific syntax.
GROUP BY allows us to group identical values to aggregate data. What is not obvious is that it can be easily used to group values that belong to the same range, as well.