diff --git a/database/sqlite/queries/entryGetAll.sql b/database/sqlite/queries/entryGetAll.sql index 2868860..6d9fd93 100644 --- a/database/sqlite/queries/entryGetAll.sql +++ b/database/sqlite/queries/entryGetAll.sql @@ -3,13 +3,10 @@ SELECT `entry`.`created`, `entry`.`name`, `entry`.`message`, - CASE - WHEN `entry`.`hide_website` IS FALSE - THEN `entry`.`website` - ELSE '' - END AS `website`, - `reply`.`created` AS `reply_created`, - `reply`.`message` AS `reply_message` + `entry`.`website`, + `entry`.`hide_website`, + COALESCE(`reply`.`created`, 0) AS `reply_created`, + COALESCE(`reply`.`message`, '') AS `reply_message` FROM `entry` LEFT JOIN `reply` ON `entry`.`entry_id` = `reply`.`entry_id`