On 23 Apr 2004 at 7:23, Bill Easton wrote: > The last suggestion is useful when you do care which entries you get, > as you can use one order for limit and another for presentation. For > example, if you'd like the LAST 10 rows, but sorted in FORWARD order, > you can use something like > > (select * from HISTORY order by version desc limit 10) order by > version; > > And I thought I'd have to wait for subqueries...
One small gotcha that Anders Karlsson pointed out to me through Paul DuBois: This one-query union syntax doesn't allow you to use the ALL keyword after UNION (since the UNION keyword isn't even there). That means it will always eliminate duplicate rows (like DISTINCT). That hasn't come up when I've used it, since I've never been selecting result sets that could contain duplicate rows, but it's something to keep in mind. -- Keith C. Ivey <[EMAIL PROTECTED]> Tobacco Documents Online http://tobaccodocuments.org -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]