Sorting recordsets

When you fetch a recordset with the search() method, you can pass an optional argument order to get a recordset that's in a particular order. This is useful if you already have a recordset from a previous bit of code and you want to sort it. It may also be useful if you use a set operation to combine two recordsets, for example, which would cause the order to be lost.

This recipe shows you how to use the sorted() method to sort an existing recordset. We will sort books by release date.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset