All examples are not tested.
Assumptions:
1) Characters are left justified.
For example, ' AA ' or 'A B ' are not in the column.
2-1) There is a possibility that one of first two characters is numeric and another one is not numeric.
For example, 'A7 ' or '4V '
2-2) Include(not filter out) those values.
Example 1:
Code:
WHERE SUBSTR(char4 , 3 , 2) = ''
AND SUBSTR(char4 , 2 , 1) <> ''
AND
( SUBSTR(char4 , 1 , 1) NOT BETWEEN '0' AND '9'
OR SUBSTR(char4 , 2 , 1) NOT BETWEEN '0' AND '9'
)
Example 2:
Code:
WHERE LENGTH( RTRIM(char4) ) = 2
AND
( SUBSTR(char4 , 1 , 1) NOT BETWEEN '0' AND '9'
OR SUBSTR(char4 , 2 , 1) NOT BETWEEN '0' AND '9'
)
Example 3:
Code:
WHERE LENGTH( RTRIM(char4) ) = 2
AND TRANSLATE(char4 , '' , '0123456789' , ' ') <> ''
Example 4:
Code:
WHERE LENGTH( RTRIM(char4) ) = 2
AND LOCATE( SUBSTR(char4 , 1 , 2)
, '00102030405060708091121314151617181922324252627282933435363738394454647484955657585966768697787988990'
) = 0
If assumption 2) was not true
(i.e. if one character was a digit then all other characters must be digits),
then
LENGTH( RTRIM( TRANSLATE(char4 , '' , '0123456789' , ' ') ) ) = 2