Create a new table regexp_temp
CREATE TABLE regexp_temp(empName varchar2(20))
Table created.
Inserting rows into the regexp_temp table
INSERT INTO regexp_temp (empName) VALUES ('John Doe')
1 row(s) inserted.
Inserting rows into the regexp_temp table
INSERT INTO regexp_temp (empName) VALUES ('Jane Doe')
1 row(s) inserted.
Query the table column and count a specific character
SELECT empName, REGEXP_COUNT(empName, 'e', 1, 'c') "CASE_SENSITIVE_E" From regexp_temp
EMPNAME | CASE_SENSITIVE_E |
---|---|
John Doe | 1 |
Jane Doe | 2 |
Query the table column and count a specific character
SELECT empName, REGEXP_COUNT(empName, 'o', 1, 'c') "CASE_SENSITIVE_O" From regexp_temp
EMPNAME | CASE_SENSITIVE_O |
---|---|
John Doe | 2 |
Jane Doe | 1 |
Query the table column and count a specific character
SELECT empName, REGEXP_COUNT(empName, 'E', 1, 'i') "CASE_INSENSITIVE_E" From regexp_temp
EMPNAME | CASE_INSENSITIVE_E |
---|---|
John Doe | 1 |
Jane Doe | 2 |
Query the table column and count a specific string
SELECT empName, REGEXP_COUNT(empName, 'do', 1, 'i') "CASE_INSENSITIVE_STRING" From regexp_temp
EMPNAME | CASE_INSENSITIVE_STRING |
---|---|
John Doe | 1 |
Jane Doe | 1 |
Query the table column and count a specific string in uppercase
SELECT empName, REGEXP_COUNT(empName, 'an', 1, 'c') "CASE_SENSITIVE_STRING" From regexp_temp
EMPNAME | CASE_SENSITIVE_STRING |
---|---|
John Doe | 0 |
Jane Doe | 1 |
Drop the table
DROP TABLE regexp_temp
Table dropped.