18 lines
444 B
MySQL
18 lines
444 B
MySQL
|
SELECT
|
||
|
`entry`.`entry_id`,
|
||
|
`entry`.`created`,
|
||
|
`entry`.`name`,
|
||
|
(CASE
|
||
|
WHEN `entry`.`hide_website` IS FALSE
|
||
|
THEN `entry`.`website`
|
||
|
ELSE ''
|
||
|
END) AS `website`,
|
||
|
`entry`.`message`,
|
||
|
`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 ?;
|