[GIS] How to select a number of rows based on current sort order

arcgis-10.1arcgis-desktopsql

I would like to be able to select a certain number of rows from my attribute table based on their ordering and not their attributes. For example, if I sort by ObjectID, I then want to select the top 100 rows. If I then alphabetise the Name field, I want to be able to select the top 150 rows.

According to the help files on building a query expression:

Because you are selecting columns as a whole, you cannot restrict the SELECT to return only some of the columns in the corresponding table because the SELECT * syntax is hard-coded. For this reason, keywords, such as DISTINCT, ORDER BY, and GROUP BY, cannot be used in an SQL query in ArcGIS except when using subqueries.

In this SO question it shows how to achieve this using a subquery, but it seems to depend on the WHERE clause being part of the subquery.

Best Answer

Do you want to manually apply multiple sort and selections to an attribute table? This technique may help. Sort and Select the desired rows in Table View, save the selection to a Layer by Right-clicking the layer, Selection, Create Layer From Selected Feature. Apply another sort and selection to the new layer. Repeat. This does Not change the original data.

Related Question