I have the following query which works correctly:
SELECT Future.enemy_type,
CASE WHEN Future.enemy_type = \'square\' THEN Users.color
ELSE \'\'
END AS color,
CAS
I like the IF() function for simple statements:
SELECT
Future.enemy_type,
IF (Future.enemy_type = 'square', Users.color, '') AS color,
IF (Future.enemy_type = 'square', Users.user_ID, '') AS ID,
IF (Future.enemy_type = 'headquarters', Users.username, '') AS username,
IF (Future.enemy_type = 'headquarters', Users.home_lat, '') AS lat
FROM Future
LEFT JOIN Users
ON Future.user_ID_affected = Users.user_ID
WHERE
Future.time > 1539503510 AND
Future.time <= 1539503512 AND
Future.user_ID = 10;