On Thu, Oct 20, 2011 at 00:06, Basil Daoust <bdaoust@stripped> wrote:
> For me given the sample data the following worked.
> The inner select says find all first messages, the outer says give me all
> messages that are thus not first messages.
>
> select * from table1 where messageID NOT IN (
> select messageID from table1
> group by userID
> )
>
> Some times just playing with the data will result in an aha moment.
Wow, nice! That looks to be the elegant, simple solution that I do
need. The real-world example is more contrived but I should be able to
use this method to do it cleanly. It will involve a sort and a limit
on the inner select. Thanks!
> I'm assuming where you show row 7 you meant row 8?
>
Yes, that is what I meant. As someone wiser than myself once said: to
err is human, but to really mess things up we need a computer!
--
Dotan Cohen
http://gibberish.co.il
http://what-is-what.com