Convert a UNIX timestamp to a datetime with MySQL

Dates and times can be stored as an integer value as a UNIX timestamp. This isn’t a particularly human readable format but can be converted in MySQL to a datetime value using the FROM_UNIXTIME function.

MySQL: Using IF in a WHERE clause

I recently needed to use an IF statment in a WHERE clause with MySQL. This isn’t the most ideal situation and should probably be avoided normally but we needed to do it for one reason or another and this post shows how to do it.

MySQL utility commands

This post is a summary of MySQL posts from this blog relating to MySQL utility commands, such as describing table structure, dropping columns from a table, and so on; and server settings.

String concatenation with MySQL – Part 2

A few months ago I posted about string concatenation with MySQL using the CONCAT function and in this follow up post look at the CONCAT_WS function which glues the fields together with the specified string. CONCAT_WS means CONCATenate With Separator i.e. join the fields together with a specified separator string.

Auto increment a value on the fly with MySQL

By assigning a value to a variable in MySQL and incrementing the variable as part of a select statement, it’s possible to have anumber auto-incremented on the fly. This number has no other reference to the table other than the order the data is selected . It is also possible to auto increment the variable when running an update statement so a new set of incrementing values could be stored into the table.

MySQL Query Browser “The memory load of the system is extremely high” error

The MySQL Query Browser is a GUI tool for running queries on MySQL database servers. This post looks at an issue where the query browser reports an issue with memory load being extremely high and prevents the query from running. There are versions of the MySQL Query Browser for Windows, OS/X and Linux (or you can compile from source); I got this error on the Windows version and it may or may not affect the other platforms.