I'm constructing a query using SQLAlchemy and SQLite3 in which I'd like to select rows in which a String column contains a particular substring. What is the best way to accomplish this?
You can filter using contains operator:
contains
Model.query.filter(Model.columnName.contains('sub_string'))
To negate in, use not_ operator with it:
not_
Model.query.filter(not_(Model.columnName.contains('sub_string')))
1.4m articles
1.4m replys
5 comments
57.0k users