最初のアプローチ。この選択は3行を返します。選択した行と前の日付の行、および次の日付のアノード行:
SELECT * FROM (
SELECT
'THIS' as update_time,
update_id,
project_id,
content,
date
FROM
`update`
WHERE
update_id = 2 AND project_id = 2
ORDER
BY date DESC
LIMIT 1
) TT
UNION
SELECT * FROM (
SELECT
'PREVIOUS' as update_time,
update_id,
project_id,
content,
date
FROM
`update`
WHERE
update_id <> 2 AND project_id = 2 and
date <= (select date from `update` where update_id = 2)
ORDER
BY date DESC
LIMIT 1
) TP
UNION
SELECT * FROM (
SELECT
'NEXT' as update_time,
update_id,
project_id,
content,
date
FROM
`update`
WHERE
update_id <> 2 AND project_id = 2 and
date >= (select date from `update` where update_id = 2)
ORDER
BY date ASC
LIMIT 1
) TN