On Wed, 3 Jul 2013 22:49:51 -0500
"Jay A. Kreibich" <j...@kreibi.ch> wrote:

>   So anyways, I don't actually care about the actual number of orders,
>   which is mostly likely what my SQL query returns, I just want the
>   ranking-- who is first, second, and third.  I can get that from an
>   ORDER BY query, but the data that makes up the result set doesn't
>   actually contain the information I want.  The information I want is
>   encoded into the row order of the result set, not the data values of
>   the result.  In other words, the row order is extremely relevant,
> and part of the desired result itself.   That's about as
> non-Relational as you can get.

I enjoyed your post, Jay, and hereby place my  bet that it wins HAVING
MAX(COUNT(words)) FROM sqlite-users for July.  ;-)  

I beg to differ on this bit of your analysis, though.  To say the
rank information you want is "encoded in the order" is like saying the
count information is encoded in the number of rows produced.  What you
really mean is that one is derived from the other.  True, you can infer
what you want to know from what you see, but you can also compute it
(by counting, or by counting the lessers).  Nothing non-relational
about it.  

>         "Give me a list of the top 10 sales regions for
>       last quarter, ranked by total number of orders."
...
>   Of course the result is very non-Relational, since the inherent
>   information I asked for is dependent on row order

No row order is implied.  Rank depends not on *row* order, but on total
number of orders.  There is no reason the rows couldn't be displayed in
another order (say, by region name) causing their ranks to appear in
4,3,6,8,9,2... order.  The fact that the query can be expressed in SQL
without reference to a row number confirms the point.  

That's good news: the relational heart of SQL, however trampled and
starved, still beats on.  

--jkl
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to