Sample Header Ad - 728x90

Find rows where column starts with A - P or AA - AE

0 votes
2 answers
60 views
I have a name column and I need to check whether it starts with letters A to P, or the first 2 letters of the name are AA to AE. I tried this: select name from table where substring(name,1,1) ~* '^[A-P]' or substring(name,1,2) ~* '^[AA-AE]'; This didn't work.
Asked by skg (3 rep)
May 19, 2025, 09:07 AM
Last activity: May 20, 2025, 01:07 AM