I don’t see any order by API in C client v4.3.6. I was searching for APIs like as_query_orderby_inita(), as_query_orderby(). There are mentioned in the documentation Is this still supported?
Query ordering is not supported. The documentation references will be removed in the next C client release.
You might want to explore this discussion link: Order by option Looks like someone has developed a stream udf to do order by with limit.