SCOTT@orcl_11g> CREATE TABLE your_table
2 (name VARCHAR2 (30))
3 / 4 INTO your_table VALUES ('MAHAMMAD')
5 INTO your_table VALUES ('MAHHAMMAD')
6 INTO your_table VALUES ('SOMEBODY')
Table created.
SCOTT@orcl_11g> INSERT ALL
2 INTO your_table VALUES ('MOHAMAD')
3 INTO your_table VALUES ('MUHAMMAD')
7 SELECT * FROM DUAL
8 /
5 rows created.
-- soundex:
SCOTT@orcl_11g> SELECT *
2 FROM your_table
3 WHERE SOUNDEX ('MOHAMMAD') = SOUNDEX (name)
4 /
NAME
------------------------------
MOHAMAD
MUHAMMAD
MAHAMMAD
MAHHAMMAD
-- jaro winkler:
SCOTT@orcl_11g> SELECT UTL_MATCH.JARO_WINKLER_SIMILARITY ('MOHAMMAD', name) jws,
2 name
3 FROM your_table
4 ORDER BY jws DESC
5 /
JWS NAME
---------- ------------------------------
97 MOHAMAD
92 MUHAMMAD
83 MAHAMMAD
81 MAHHAMMAD
47 SOMEBODY
-- Oracle Text search using soundex operator (!):
SCOTT@orcl_11g> CREATE INDEX your_idx ON your_table (name)
2 INDEXTYPE IS CTXSYS.CONTEXT
3 /
Index created.
SCOTT@orcl_11g> SELECT name
2 FROM your_table
3 WHERE CONTAINS (name, '!MOHAMMAD') > 0
4 /
NAME
------------------------------
MOHAMAD
MUHAMMAD
MAHAMMAD
MAHHAMMAD
Halim, a Georgia Tech graduate Senior Database Engineer/Data Architect based in Atlanta, USA, is an Oracle OCP DBA and Developer, Certified Cloud Architect Professional, and OCI Autonomous Database Specialist. With extensive expertise in database design, configuration, tuning, capacity planning, RAC, DG, scripting, Python, APEX, and PL/SQL, he combines technical mastery with a passion for innovation. Notably, Halim secured 16th place worldwide in PL/SQL Challenge Cup Playoff on the year 2010.
Subscribe to:
Post Comments (Atom)
My Blog List
-
-
-
ASSM states3 weeks ago
-
UKOUG Discover 20241 month ago
-
-
-
-
-
-
-
-
Moving Sideways8 years ago
-
-
Upcoming Events...11 years ago
-
No comments:
Post a Comment