We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37351db commit c7020f7Copy full SHA for c7020f7
datajoint/expression.py
@@ -124,12 +124,11 @@ def where_clause(self):
124
def sorting_clauses(self):
125
if not self._top:
126
return ""
127
- clause = (
128
- ""
129
- if not any(_flatten_attribute_list(self.primary_key, self._top.order_by))
130
- else f" ORDER BY \
131
- {', '.join(_flatten_attribute_list(self.primary_key, self._top.order_by))}"
+ clause = ", ".join(
+ _flatten_attribute_list(self.primary_key, self._top.order_by)
132
)
+ if clause:
+ clause = f" ORDER BY {clause}"
133
if self._top.limit is not None:
134
clause += f" LIMIT {self._top.limit} \
135
{f' OFFSET {self._top.offset}' if self._top.offset else ''}"
0 commit comments