I have a table called recentOrders and I want to return the row which has the highest value (basically the latest order number) from the column OrderID.
I can return a single seemingly random row with:
s = recentOrders.select()
rs = s.execute()
row = rs.fetchone()
print(row)
and I've tried various things along the lines of:
s = recentOrders.select().order_by(OrderID.desc())
rs = s.execute()
row = rs.fetchone()
print(row)
But I get an error of
NameError: name 'OrderID' is not defined
What's the correct syntax for a query?