×
We value your feedback! Please click here to access our 2024 Client Survey.
The survey will remain open until November 1st. Your perspective will help guide our product/service planning and goals for the upcoming year and beyond!

Cannot sort the results of a query with SELECT * ?

LabKey Support Forum
Cannot sort the results of a query with SELECT * ? Matthew Bellew  2013-05-21 12:37
Status: Closed
 
This is a long-standing design problem with the LabKey query APIs. The problem is that anytime you use a query you really have two components. a) the query/table b) the view over the query.

Unfortunately, these two parts don't cooperate very well, and the view definition's sort order will over ride the "ORDER BY" in the sql. In the first case since there's only one column the view is choosing to sort using it and it looks like the "ORDER BY" is working.

The solution is to use the separate "config.sort" property of the API call. We should add better documentation for this with our SQL reference.

Matt