Reputation: 69
I have a Profile named School
Table is :
id[pk] name division
------ ---- --------
1 100 John 2
2 102 Maria 5
3 108 Hooper 4
PK Column Type: 'Numeric'.
How do get all the id values sequentially from the very first to the last using python?
Upvotes: 2
Views: 64
Reputation: 83808
Here:
for row in dbsession.query(School.id).order_by(School.id):
print(row[0])
Upvotes: 2