1

I have a database table called shop. Every shop has a string title.

I'm now trying to get all the shops that has a title that does not start with an English alphabet character.

So now I'm doing something like:

shops = db.query(Shop)\
        .filter(Shop.title.like('SOME_EXPRESSION'))\
        .all()

May I know what to choose for SOME_EXPRESSION please? Do I need a regular expression here? Or some other expression?

From what I know, if I put A% there, it is getting all shops with title that starts with A.

1
  • Here is a question with answers that show ways to do this in SQL. Once you know that, you can convert the SQL to SQLAlchemy. Oct 27, 2013 at 16:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.