Martin: Good question. CASE is an if/then/else for SQL statements, see the MySQL manual page for it: http://dev.mysql.com/doc/refman/5.0/en/case-statement.html Perhaps I should post some examples of using it as a blog entry one day