Jika suka adalah angka unik, mengikuti harus berfungsi.
sebelumnya:
SELECT * FROM table WHERE likes < (SELECT likes FROM table WHERE id = ID) ORDER BY likes DESC LIMIT 1
selanjutnya:
SELECT * FROM table WHERE likes > (SELECT likes FROM table WHERE id = ID) ORDER BY likes ASC LIMIT 1
Anda dapat mengubah 1 dari mereka menjadi <=atau>=dan menambahkan WHERE id != ID