Fix exception during https://danbooru.donmai.us/posts/random?tags=ordfav:nonamethanks Before we were doing a query like this: SELECT "posts".* FROM "posts" INNER JOIN "favorites" ON "favorites"."post_id" = "posts"."id" WHERE (favorites.user_id % 100 = 64 AND favorites.user_id = 52664) AND "posts"."id" = 343894 ORDER BY favorites.id DESC, posts.id DESC, ID=343894 DESC but `ID=? DESC` is ambiguous during an ordfav: search because of the join on the favorites table. The fix is to qualify the reference as `posts.id`.