Random DB selection
SELECT * FROM table ORDER BY RANDOM() LIMIT 1
Oh God, this solves quite a few problems for me at the moment. If only I’d spotted this a month ago.
sigh.
back to the drawing board.
Update: for other RDBMs
Update2: After reading all the comments on Daily WTF I think I’ll just go and hide in a dark room for a few days and pretend it all never happened.