Yes, you can ask this request: -
I have a column element with 6 digit codes.
I get an element whose first digit is 4 or 6, equal to 9.
we must use % and _ to select.
SELECT element FROM "table" WHERE element LIKE '%4____9%';
try it, it will work.
Everything that starts with 4, with the exception of elements starting with 411, 427 and 428: -
SELECT element FROM "table" WHERE element LIKE '%4__';
The 1st digit is 4, and the 6th is not 9: I tested this, it works fine, try the following: -
SELECT element FROM "table" WHERE element NOT LIKE '%_____9' and element LIKE '%4_____'
source share