Searching for "one_word"
st = con.createStatement();
rs = st.executeQuery
("SELECT value FROM vendors WHERE value LIKE 'one/_word' {escape '/'}");
Searching for strings ending with "one%word"
st = con.createStatement();
rs = st.executeQuery
("SELECT value FROM vendors WHERE value LIKE '%one/%word' {escape '/'} ");
Find all rows in which a begins with the character "%"
st = con.createStatement();
rs = st.executeQuery
("SELECT value FROM vendors WHERE value LIKE '$%%' {escape '$'}");
Find all rows in which a ends with the character "_"
st = con.createStatement();
rs = st.executeQuery
("SELECT value FROM vendors WHERE value LIKE '%=_' {escape '='}");
For Oracle, it will look like this :
SELECT value FROM vendors WHERE value LIKE '%=_%' ESCAPE '=';
Written and compiled by Réal Gagnon ©1998-2012
[ home ]