http://thedailywtf.com/Articles/The-Hot-Room.aspx
You see how at the bottom there're links to the next and previous articles ("Unprepared For Divide_By_Zero" and "A Completely Different Game")? How do I do that, but selecting the next and previous non-private articles? This works for selecting the next article:
SELECT * FROM articles WHERE id > ? AND private IS NULL
But I cannot find a way to select the previous article.
What is the proper/efficient way to do this, preferably in one query?