in reply to Re: mySQL query
in thread mySQL query

Yes, this will work - but it is not portable: you need a different syntax for different data servers.

The solution outlined by Abigail-II is generic for any Relational database server, and should be as fast (or faster) with proper indexes.

Michael