;>>> 2011/10/19 17:06 -0500, Basil Daoust >>>> 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 ) <<<<<<<< Well done--but.... Although, it seems, it is everyone s experience that the desired order is the order that MySQL yields, all guarantee of that is explicitly deny'd (look up 'GROUP BY'). It is better to be safe and to use "MIN": select * from table1 where messageID NOT IN ( select MIN(messageID) from table1 group by userID ) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org