8 ms·
Although this post doesn't establish the premise sufficiently to comment on the data or its schema, I would venture that much of the time what you want is a GRO
by SloopJon 3y ago
Although this post doesn't establish the premise sufficiently to comment on the data or its schema, I would venture that much of the time what you want is a GROUP BY query on columns of the table, rather than a column of pointers.
What distinguishes a Foo from a Bar? Are 1, 2, and 3 (or I, II, etc.) actual data values, or simply row numbers arising from a sort on something else?
If you're writing the back end for OmniOutliner, and you must use a relational database, then maybe you'll use tricks like these. Otherwise, I would see whether you can come up with a schema that better models your data.