Get the First Day of the Month in PostgreSQL

We can use the following method in PostgreSQL to return the first day of a given month.

This could be the first day of the current month, or the first day of the month based on a date that we specify.

Getting the first day of the month allows us to perform further calculations on the resulting date, like adding a certain number of days to the start of the month, etc.

Read more

nullvalue: Show NULL Values in SQLite

When using the SQLite command line interface (CLI), by default, whenever a query returns a null value, the output is the empty string ('').

We can change this by using the -nullvalue command line option when launching SQLite.

We can also use the .nullvalue dot command if we’re already in the SQLite CLI.

Read more