CODE
Oracle Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
PSOUG Home Code Snippets Oracle Reference Oracle Functions PSOUG Forum Oracle Blogs Bookmark and Share
 
 Search the Reference Library pages:  

Free
Oracle Magazine
Subscriptions
and Oracle White Papers

Oracle Wildcards
Version 11.1
 
Demo Table And Records
Demo Data CREATE TABLE wildcard (
test VARCHAR2(25));

INSERT INTO wildcard VALUES ('23%45');
INSERT INTO wildcard VALUES ('2345');
INSERT INTO wildcard VALUES ('2365');
INSERT INTO wildcard VALUES ('Daniel Morgan');
INSERT INTO wildcard VALUES ('Washington');
COMMIT;
 
Wildcard Characters
Single Character

_ (underscore)

SELECT *
FROM wildcard
WHERE test LIKE '23_5';
Multiple Characters  
SELECT *
FROM wildcard
WHERE test LIKE '2%5';
Mixed Single And Multiple Characters SELECT *
FROM wildcard
WHERE test LIKE '_3%5';
Complex Statement SELECT *
FROM wildcard
WHERE test LIKE '%a%a %';
 
Querying Records Containing Wildcards
Find Records Containing Percentage Sign ESCAPE '<escape_character>'
SELECT *
FROM wildcard
WHERE test LIKE '%\%%' ESCAPE '\';
 
Related Topics
Delete
Insert
Select
Update
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us [142 users online]    © 2010 psoug.org