I have an Info table, when a certain number of entries are reached, I want to delete the very first entry.
Table: class Info(TimedBaseModel): __tablename__= 'information' id= Column(BigInteger) info= Column(String(200)) query: sql.Select
Is there any way to change this code so that it only removes the first element? It completely clears the entire table:
await Info.delete.where(message.from_user.id== Info.id).gino.status()
Answer # 1
info= await Info.query.gino.first() await info.delete()
- python postgresql sql how to pass string type parameter to query
- sql : How to use array as freight key?
- sql : Is it possible to make a polymorphic relationship in Yii2?
- python : Problem with SQLite
- python : Why are passed values treated as column names when inserting into a table? [duplicate]
- python : What is the best way to substitute values from variables /lists /dictionaries in a SQL query?
- python : Can I get a True\False response instead of a value in Sqlite?
- python : Unable to get responses from users in telegram bot
- sql : What is the difference between EXISTS and IN subqueries?