On 2017/01/26 6:23 PM, [email protected] wrote:
Thanks for responses, I have an other problem
select * from (select row_number(name) as id,name from example order
by name desc) t order by name
In this query, the server why doesn't use the nested "order by"?
I want to numbering the inner data descending, but I can't, because
looks like, the server ignores it.
There exists no such thing as "nested" ORDER BY clauses. One and only
one ORDER BY clause can ever determine ordering. The outer-most is the Boss.
What you perhaps are trying to achieve is this:
SELECT COUNT(B.name) AS id, A.name
FROM example AS A
LEFT JOIN example AS B ON B.name < A.name
GROUP BY A.name
ORDER BY A.name
Couldn't test it so there might be a typo in there, but the principle works.
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users