I'm building a web app using Python and SQLAlchemy.
I'm using the following code to retrieve records.
yardDB.query.order_by(yardDB.PIT.asc())
It is returning records based on the ascending order in my "PIT" column, but it's not returning it in the way I need it to. (Green highlight in picture below)
*Note, the Seq column is not the same as the green column. Also the green column is hidden, but I unhid it to see how it's returning the records.
Picture of how it's returning records
I need it to simply return the rows like
1, 2, 3, .... 10, 11, ... 20, 21, ...
Edit: Listing things I've tried with no success.
- Changed my PIT column data type to Integer and String
- Added leading 00's
- Took off ascending order of query being made.
yardDB.query.order_by(yardDB.PIT)
question from:
https://stackoverflow.com/questions/65945431/sqlalchemy-order-by-returning-numbers-based-on-first-number-instead-of-the-whole 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…