How to use "regular expression" with sqlalchemy core API
https://docs.sqlalchemy.org/en/13/core/tutorial.html#conjunctions
https://www.tutorialspoint.com/sqlite/sqlite_like_clause.htm
>>> from sqlalchemy.sql import and_, or_, not_ >>> print(and_( ... users.c.name.like('j%'), ... users.c.id == addresses.c.user_id, ... or_( ... addresses.c.email_address == 'wendy@aol.com', ... addresses.c.email_address == 'jack@yahoo.com' ... ), ... not_(users.c.id > 5) ... ) ... ) users.name LIKE :name_1 AND users.id = addresses.user_id AND (addresses.email_address = :email_address_1 OR addresses.email_address = :email_address_2) AND users.id <= :id_1
Sr.No. | Statement & Description |
---|---|
1 | WHERE SALARY LIKE '200%' Finds any values that start with 200 |
2 | WHERE SALARY LIKE '%200%' Finds any values that have 200 in any position |
3 | WHERE SALARY LIKE '_00%' Finds any values that have 00 in the second and third positions |
4 | WHERE SALARY LIKE '2_%_%' Finds any values that start with 2 and are at least 3 characters in length |
5 | WHERE SALARY LIKE '%2' Finds any values that end with 2 |
6 | WHERE SALARY LIKE '_2%3' Finds any values that has a 2 in the second position and ends with a 3 |
7 | WHERE SALARY LIKE '2___3' Finds any values in a five-digit number that starts with 2 and ends with 3 |