Return the Start of the Month in SQLite

SQLite gives us the ability to return the date of the beginning of the month, based on a given date.

This means we can return the date of the first day of the current month, or the first day of the month based on a date that we specify.

This allows us to perform further calculations on the resulting date, like adding a given number of days to it.

Continue reading

Fix “ERROR 1054 (42S22): Unknown column ‘…’ in ‘on clause'” in MariaDB

If you’re getting an error that reads something like “ERROR 1054 (42S22): Unknown column ‘tab.ColName’ in ‘on clause”” in MariaDB, here are three likely causes:

  • The column doesn’t exist.
  • You’re trying to reference an aliased column by its column name.
  • Or it could be the other way around. You could be referencing the column with an alias that was never declared.
Continue reading