I have a variable of type character varying (17) and need to separate one of the characters, for example the third letter, and use it to filter.
SELECT *
FROM fnord
WHERE terceira(illuminati) = "a"
I have a variable of type character varying (17) and need to separate one of the characters, for example the third letter, and use it to filter.
SELECT *
FROM fnord
WHERE terceira(illuminati) = "a"
I think the simplest one will be (using the hint of the 3rd letter):
SELECT *
FROM fnord
WHERE substr('illuminati', 3, 1) = 'a'
The first parameter is the string
you want to validate, the 2nd is the index and the 3rd is the amount of characters you want to "remove" (it is optional).