Forum Discussion

luk's avatar
luk
Boss
6 years ago

API v2 Problem with ORDER BY multiple fields

SuzieH The docs @https://lithosphere.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv2&v2.main=usingliql#orderBy say In the ORDER BY block, you can order your query results....
  • allensmith81's avatar
    6 years ago

    Hi,

     

    is it not that you have not set a sort order on depth and so the call is assuming your passing a sort order of DEFAULT which is invalid.

    should it not be:

    SELECT id, short_title, view_href, depth, position FROM categories WHERE depth <= 2 AND id IN('<catid_1>', '<catid_2>', '<catid_n>') ORDER BY depth DESC, position ASC

    ?