While looking for some authoritative information about Sybase SQL Anywhere 12’s
TOP .. START AT clause, I stumbled upon this hilarious white paper here, which I do not want to keep from you:
I will take advantage of “fair use policy” and cite parts from section 7:
Feature number 7: improved support for DaffySQL syntax
If I told you that RowGenerator.row_num contains the values 1 through 255, what would you say this query returned?
Give up? OK, how about this one?
Still stumped? If I told you they both returned exactly the same result set as the following query, what would you say?
Yes, the LIMIT clause is new to SQL Anywhere 12, exactly the same as TOP START AT except it uses zero as the starting point for numbering rows instead of 1.
An “offset”, get it?
As in “Here’s ten dollars, let me count it for you: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.”
Why implement LIMIT? And why include it in a list of cool features?
Because there are a lot of MySQL users out there who don’t have TOP START AT, and they’ve written zillions of queries using LIMIT, and they’d like to migrate their apps to SQL Anywhere without rewriting everything. And PostgreSQL users too… welcome aboard!
Migrating to SQL Anywhere is definitely cool.
So be cool and migrate to SQL Anywhere already! 🙂 I’m now going through the rest of this fun document.