In DataJoint for Python, what is the correct syntax of the ORDER BY argument used in the fetch
command?
The current documentation (as of 2018-08-17) only specifies the following syntax for DataJoint in MATLAB:
s = fetch(experiment.Session, '*', 'ORDER BY session_date DESC LIMIT 5')
In Python, the correct syntax for the ORDER BY argument is
If you need to sort by multiple attributes, provide them as a tuple:
This will sort the fetched items in ascending order with respect to the specified attributes. To make it descending, add the word
DESC
to the attributes.You may optionally also use the word
ASC
to make the ascending order implicit but omitting it has the same effect.