1
0
justguestbook/internal/database/sqlite/queries/entryGetAll.sql

18 lines
444 B
MySQL
Raw Normal View History

2022-10-19 03:25:43 +04:00
SELECT
`entry`.`entry_id`,
`entry`.`created`,
`entry`.`name`,
`entry`.`message`,
2022-10-19 03:25:43 +04:00
(CASE
WHEN `entry`.`hide_website` IS FALSE
THEN `entry`.`website`
ELSE ''
END) AS `website`,
`reply`.`created` AS `reply_created`,
`reply`.`message` AS `reply_message`
FROM `entry`
LEFT JOIN `reply`
ON `entry`.`entry_id` = `reply`.`entry_id`
ORDER BY `entry`.`entry_id` DESC
LIMIT ?
OFFSET ?;