<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 31 Oct 2009, at 12:02, John McKerrell wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 31 Oct 2009, at 10:53, John McKerrell wrote:</div><blockquote type="cite"><div><font class="Apple-style-span"><br></font><span class="Apple-tab-span" style="white-space:pre"> </span>SELECT DISTINCT p.id FROM photos p LEFT OUTER JOIN moderators m ON <br>m.photo_id = p.id WHERE p.status = 'moderation' AND ( m.id IS NULL OR <br>m.user_id <> ?)<br></div></blockquote><div><br></div>I've just realised this isn't going to work, if someone else has moderated a photo then it will be offered back to you, I'll need to use the version below. Doesn't seem too slow right now, might get that way when there's more users but should be fine for now.</div></div></blockquote></div><br><div>Ok, that's done, you are guaranteed* to always have 10 photos to moderate.</div><div><br></div><div>John</div><div><br></div><div>* by which I mean, it'll probably work this time</div></body></html>