Search code examples
oraclecharacterreserved

'%' express any characters, is there any special character for only one character?


In Oracle '%' stands for any characters in that position. Example:

Select * from table where id like '%1'

This stands for anything behind the number 1 : XXXXXXXXXXXX1 99999999991.

Is there any other character to express only 1 character ?.

Example of what I mean: (im going to use ~ as that reserved character)

Select * from table where id like '~1'

In this case only 91, x1, X1... etc would enter the select, but XX1 woudn't as you only used one ~.

Select * from table where id like '~~~1'

xxx1, 9991, 8881, etc....

Hope I explained myself, english is not my native language.


Solution

  • Only one wildcard character is represented by underscore, _