Regex for wild-card search
Hi allcan I use regex to search for wild-card in my sql query?
If Yes, then how to implement abc def % in the regex
from now I use "as abc % def %' in my sql statement
Thank you
Manju
manjukn wrote:
Hi all
can I use regex to search for wild-card in my sql query?If Yes, then how to implement abc def % in the regex
from now I use "as abc % def %' in my sql statement
for example
SQL> select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7934 MILLER CLERK 7782 23-JAN-82 1300 10
1111 WILLIS CLERK 7902 18-JAN-08 900 20
15 rows selected.
SQL> select * from emp
2 where regexp_like(ename,'.*ILL.*');
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7934 MILLER CLERK 7782 23-JAN-82 1300 10
1111 WILLIS CLERK 7902 18-JAN-08 900 20
SQL>
Tags: Database
Similar Questions
-
Search for wild-card using %
I have a question about wild-card searches. I currently have a behind the scenes as to search for a string within a string...
However, if the user wants to put in a wild card like '% report % AP... I would like to go back to all those who start with AP and relate to them - is - it possible using APEX? I currently do not receive all the records as the % is considered literally. As our users are used for Oracle, we will have users who will be key in a % when searching and we need it works!
Can someone help me with this please?
Thank you!
RobetAhh, one of us was on a red herring, sorry.
Not accustomed to see double quotes, don't think that they are identifiers case-insensitive to column do not.
Your original code
instr(upper("REPORT_DESC"),upper(nvl(:P11_REPORT_SEARCH,"REPORT_DESC"))) > 0
Is the same as
upper(report_desc) like '%'||UPPER(:P11_REPORT_SEARCH)||'%'
Then you may as well write it like this, and then the winning cards will be interpreted as such.
Scott
-
Hello
I have a requirement in which I need to find similar names in two different tables. for example, I have 2 tables: -.
CREATE TABLE CUST_NAME1 (CUSTOMER_NAME1 VARCHAR2 (1000));
CREATE TABLE CUST_NAME2 (CUSTOMER_NAME2 VARCHAR2 (1000));
INSERT INTO CUST_NAME1 VALUES ('JOHN SMITH');
INSERT INTO CUST_NAME1 VALUES ("GEORGE BUSH");
INSERT INTO CUST_NAME1 VALUES ('MIKE ABRAHAM LINCOLN');
INSERT INTO CUST_NAME2 VALUES ('JOHN SMITH');
INSERT INTO CUST_NAME2 VALUES ("GEORGE W. BUSH");
INSERT INTO CUST_NAME2 VALUES ('ABRAHAM LINCOLN');
Now, I understand that they may be the same person or not, but I want to give smilar matches (1st row = rank 1 and so on)
How to efficiently search using sql/regular expression or pl sql depending on what is feasible?
Published by: 974647 on May 2, 2013 11:46
Published by: 974647 on May 2, 2013 12:06Have a look at UTL_MATCH:
with customers as ( select 'JOHN SMITH' as customer_name from dual union all select 'GEORGE BUSH' from dual union all select 'LINCOLN MIKE ABRAHAM' from dual union all select ' SMITH JOHN' from dual union all select 'GEORGE W BUSH' from dual union all select 'ABRAHAM LINCOLN' from dual ) select c1.customer_name name1 , c2.customer_name name2 , utl_match.edit_distance_similarity(c1.customer_name, c2.customer_name) ed_similarity , utl_match.jaro_winkler_similarity(c1.customer_name, c2.customer_name) jw_similarity from customers c1, customers c2 order by jw_similarity desc, ed_similarity desc, name1, name2; NAME1 NAME2 ED_SIMILARITY JW_SIMILARITY -------------------- -------------------- ------------- ------------- SMITH JOHN SMITH JOHN 100 100 ABRAHAM LINCOLN ABRAHAM LINCOLN 100 100 GEORGE BUSH GEORGE BUSH 100 100 GEORGE W BUSH GEORGE W BUSH 100 100 JOHN SMITH JOHN SMITH 100 100 LINCOLN MIKE ABRAHAM LINCOLN MIKE ABRAHAM 100 100 GEORGE BUSH GEORGE W BUSH 85 96 GEORGE W BUSH GEORGE BUSH 85 96 SMITH JOHN JOHN SMITH 19 63 JOHN SMITH SMITH JOHN 19 63 GEORGE BUSH JOHN SMITH 19 58 JOHN SMITH GEORGE BUSH 19 58 LINCOLN MIKE ABRAHAM GEORGE BUSH 25 56 LINCOLN MIKE ABRAHAM SMITH JOHN 20 56 ABRAHAM LINCOLN LINCOLN MIKE ABRAHAM 10 55 LINCOLN MIKE ABRAHAM ABRAHAM LINCOLN 10 55 ABRAHAM LINCOLN SMITH JOHN 20 53 LINCOLN MIKE ABRAHAM GEORGE W BUSH 20 53 JOHN SMITH LINCOLN MIKE ABRAHAM 25 52 LINCOLN MIKE ABRAHAM JOHN SMITH 25 52 GEORGE W BUSH JOHN SMITH 24 51 JOHN SMITH GEORGE W BUSH 24 51 SMITH JOHN LINCOLN MIKE ABRAHAM 20 51 SMITH JOHN ABRAHAM LINCOLN 20 48 GEORGE W BUSH LINCOLN MIKE ABRAHAM 20 47 ABRAHAM LINCOLN JOHN SMITH 14 47 JOHN SMITH ABRAHAM LINCOLN 14 47 SMITH JOHN GEORGE BUSH 10 45 GEORGE BUSH SMITH JOHN 10 45 SMITH JOHN GEORGE W BUSH 8 44 GEORGE W BUSH SMITH JOHN 8 44 GEORGE BUSH LINCOLN MIKE ABRAHAM 25 43 ABRAHAM LINCOLN GEORGE W BUSH 7 42 GEORGE W BUSH ABRAHAM LINCOLN 7 42 ABRAHAM LINCOLN GEORGE BUSH 7 37 GEORGE BUSH ABRAHAM LINCOLN 7 37 36 rows selected.
-
Search in Vista using a wild card (asterisk or question mark + dot + suffix)
How to search in Vista using a wild card (asterisk or question mark + dot + suffix)? I tried, but does not get results, I always could in Windows XP and earlier versions.
Hello
You can use * and? Search box in the start - menu.
Tips for finding files
http://Windows.Microsoft.com/en-us/Windows-Vista/tips-for-finding-filesHow to use advanced search in Vista Options
http://www.Vistax64.com/tutorials/75451-advanced-search.htmlHow to restore the page button on the Start Menu after installing Vista SP1
http://www.Vistax64.com/tutorials/145787-Search-start-menu-button-restore-after-SP1.htmlHow to restore the context Menu item search after installing Vista SP1
http://www.Vistax64.com/tutorials/134065-search-context-menu-item-restore-after-Vista-SP1.htmlHow to create a shortcut on the desktop search in Vista
http://www.Vistax64.com/tutorials/126499-search-desktop-shortcut.html----------------------------------------------------------
Win Key F opens advanced search
Searching in Windows Vista, part 1
http://Windows.Microsoft.com/en-us/Windows-Vista/searching-in-Windows-Vista-part-1-secrets-of-the-search-boxI hope this helps.
Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.
-
Hello
Thank you for reading my question:
by 11.2.0.3,
possible to use the wild card character in the following:
Select * from mytable where sk_name in ('TTsk_namehhh', 'DDsk_namekkk', 'POsk_namegfh', '... ») ;
To become:
Select * from mytable where sk_name in ('TTsk_namehhh %', '% DDsk_namekkk', 'POsk_namegfh %', '...) ») ;
I did find it in the documentation.
Thank you and best regards.
Thanks DOM.
but it's not clear to me. Can you be more specific please?
It would be like this:
- SELECT *.
- FROM my_table
- WHERE as sk_name (SELECT VALUE (t) FROM TABLE (CAST (TTsk_namehhh ',' DDsk_namekkk ', ' POsk_namegfh AS VARCHAR)) t);
Kind regards.
-
Text Oracle (type index CTXCAT) index does not not with wild-card leader
Hi Experts,
We are on Oracle 11.2.0.2 on Solaris 10 and I implemented the Oracle text as in the example below:
I've already implemented it and now faced with this question that queries do not work as expected - can anyone suggest what we can do for this problem?CREATE TABLE TEST_USER ( FIRST_NAME VARCHAR2(64 CHAR) NOT NULL, LAST_NAME VARCHAR2(64 CHAR) NOT NULL ); CREATE INDEX TEST_USER_IDX3 ON TEST_USER (FIRST_NAME) INDEXTYPE IS CTXSYS.CTXCAT PARAMETERS('LEXER cust_lexer'); CREATE INDEX TEST_USER_IDX4 ON TEST_USER (LAST_NAME) INDEXTYPE IS CTXSYS.CTXCAT PARAMETERS('LEXER cust_lexer'); Dont worry about the cust_lexer, it is for diacritical search and it is not relevant to this question so I am not copying the code for the preference I created etc. Now I have a row of data in the table with first_name column as Supervisor. If I run the below sql, it gives output: SELECT * FROM test_user WHERE catsearch (first_name, 'Supervisor', NULL) > 0; FIRST_NAME LAST_NAME ------------------------------ ------------------------------ Supervisor upervisor --even the below sql with wild card (*) at the end works fine... SQL> SELECT * 2 FROM test_user 3 WHERE catsearch (first_name, 'Super*', NULL) > 0; FIRST_NAME LAST_NAME ------------------------------ ------------------------------ Supervisor upervisor However the below sql queries doesn't give any output, though they should return the same row as above! SQL> SELECT * 2 FROM test_user 3 WHERE catsearch (first_name, '*visor', NULL) > 0; no rows selected SQL> SELECT * 2 FROM test_user 3 WHERE catsearch (first_name, '*vis*', NULL) > 0; no rows selected
Thank you
Published by: orausern on January 16, 2013 10:59
Published by: orausern on 16 January 2013 11:00
Published by: orausern on 16 January 2013 11:07When you create a ctxcat index, it creates different tables index field. You can query like this:
select dr$token from dr$TEST_USER_IDX3$i;
... to see which tokens are created by the indexing. In your case, I think that you will find just the word 'controller' in the name, is that you can go. This documentation gives to think than catsearch and wildcards don't mix, unless you use the query template feature.
I'm more familiar with CTXSYS. CONTEXT clues, though:
drop index TEST_USER_IDX3; SQL> CREATE INDEX TEST_USER_IDX3 ON TEST_USER 2 (FIRST_NAME) 3 INDEXTYPE IS CTXSYS.CONTEXT; SQL> select * from test_user where contains (first_name, '%vis%')>0; FIRST_NAME LAST_NAME ---------------------------------------------------------------- ----------- Supervisor Ubervisor
Anyway, since I've linked the document, I think you might need to check the query patterns.
There's a specific forum Oracle Text here, however, and if you can get Barbara Boehmer to read your question there, she'll probably have a definitive answer for you.
PS: She may already have provided in Re: wildcard search, on which she stated that "since catsearch does not support wildcards left you need context...» ».
-
Does anyone know if Flash recognizes * as a wild card table search option.
for example myArray.sorton("bob*")
Retune all table objects that contain "bob" as a prefix for an entry.
If so do you have a simple example?
Thanks in advance.No it does ' t, you need to use a custom comparison function to do.
-
printing contacts selected for Christmas cards
I use OS X 10.9.5. My contact list is great. What is the most effective way to print envelopes to a selection list for Christmas cards? I have to go through all my contacts to make a group? TIA
You will need to use an application that supports "mail merge" to a vCard file created from your Mail App (see Mail > the menu [help] > Search "vCard")
Google results > https://www.google.com/search=mail+merge+list+from+vcards...
-
Arguments using Wild-Card in Shell command authorization
The Shell permission command Set allows the use of wild-card?
For example, according to command shell permission, what can I put the arguments if I want to enable the command show interface fastethernet 0/1-24 run?
And also, what should I put in as argument for a ip address if I want to allow "ping x.x.x.x"?
Thanks in advance.
Hello
There are two wildcard characters used under authority of command Shell is the first ' ^ ' sign which designates anything that comes after this is accepted and the second wildcard is ' $' which means anything that is before. In your case, you can use
Interface FastEthernet 0 1 ^
and
Ping ^.
These commands allow access each Fastethernet and ping to an IP address.
-
To view this page, Firefox must send information that will repeat any action (for example, a search or order confirmation) that was carried out earlier. Then I have to click on return or cancel. Then I have to click on return or cancel.
How can I fix this automatically return?
Please let me know!It is not possible.
Do you use the back button to return to a previous page?
You receive an alert to send POST data if you return to a page or refresh a page that was requested in advance from the server by submitting form via a (hidden) MESSAGE form data.
Firefox can only make sure to get the same page send this POST form.
Firefox doesn't know what it means shape data, so Firefox asks for confirmation before sending the form data so action can you take to repeat an action and buy another article or post a message once.
One way to prevent this pop-up on the removal of the POST data is not to use the back button, but to open the links on a page that is requested from a server by sending a form with the date of the POST in a new tab (window) with a middle click or hold down the CTRL key and click the link.
Then you can close the tab or window to go back. -
Drivers Windows 7 x 64 for the card mother Memphis-M
Hello! I bought the HP Pavilion 500-164er with Linux operating system desktop PC.
Still, I installed Windows 7 x 64 on this unit, but I couldn't find some drivers for the card mother Memphis-M.
I need:
Simple communication controller PCI Chipset, USB 3.0.
Thank you and waiting for a response.
Hello:
You can use the W7 x 64 drivers and software of this model that has the same motherboard as yours.
DO NOT USE ANY BIOS OR THE FIRMWARE OF THIS MODEL FILES
Chip set:
Comms Simple PCI:
USB 3:
-
Re: Tecra A7 - Win XP driver for PC card Type II card necessary
I have not found on the toshiba site, the driver for the PC card slot for 1 x Type II card, type: slot Express Card?
where is it possible to download?The slot for PC card requires no additional driver and, therefore, the driver isn't available for download
-
NB100 supplied with Bluetooth and the slot for sim card
I wonder what model come with bluetooth and the slot for sim card,.
The NB100? Have a look at the brochures on the Toshiba site.
-
Instructions for opening a Z930 satellite with a slot for SIM card
Hello
I have a Satellite Z930, which I would like to open in order to replace the original SSD with a higher capacity.
Wire http://forums.computers.toshiba-europe.com/forums/thread.jspa?messageID=279122
has been very helpful.
But my PC has a slot for SIM card on the right side (side opposite the microphone and the earpiece)Even after the take-off of all 14 live (including the right of torx one downtown), back cover cannot be thrown on the side of the slot for SIM card. Something is holding back.
Anyone in the community has already managed to remove the back cover to the confiuration?
Thanks in advance for your help.
Did you manage to remove the cover?
There is no other method to remove the cover if your laptop is equipped with SIM card, first remove the SD card (dummy bridge media card), then the SIM card (you will need to insert a thin object into the hole on the sim tray) and then the 14 screws of the cover at the bottom of the unit.
All that s
-
I am looking for a card PCI UMTS for Portege M700
First of all Hi everyone, as above mentioned in the title is on the Portege M700, I am looking for a card PCI UMTS for this model have here an 8775 Sierra lying around, but unfortunately, it is not recognized in Win7, I can time can someone tell what card for this laptop is, or even something where I could get so...?
Thank you apologize in advance
Hello
You need a module 3G Broadband?
As far as I know that some of the Portege M700 series were equipped with the 3G module I think that it s of Novatel but I m not sure leave
However, if you need a framework for the Toshiba notebook that would be consistent for sure, the best place for the purchase of these parts is your ASP.
Guys could check what parts are compatible and could order from Toshiba if that would be really necessary
Welcome them
Maybe you are looking for
-
How to configure firefox to run as a single instance, so that all external links open within my existing window rather than opening another window?
-
upgrade i3 to i7 No. G7-1073
I have a Pavilion G7 CNF1132K7T has an i3 processor and I have an i7. It is poosible with current motherboard?
-
Registration of Internet dowload manager
HelloThey ask for registration of Internet download manager serial number. I don't know where to find this number. Can someone help me with this?
-
Keyboard works when I log on, and then quites 5 min later.
my keyboard stops randomnly of work I have to use the on-screen one for work; [
-
How do I enlarge the pictures in Photo Albums when you are logged into Facebook
could someone help when I go to facebook I can see my photo albums, but when I click on a photo its suppose to enlarge so you can the look, but it will not expand or I would see them. But when I go on another laptop it allows me to do so I think tha