Solved

Oracle WildCards

Posted on 2002-06-24
4
2,679 Views
Last Modified: 2008-01-16
In SQL Server I can use:
where columnname like '[A,D,X]%'
to find all values that start with an A or a D or an X.
I can also use:
where columnname like '[A-D,X]%'
to find all values that start with an A or a B or a C or a D or an X.
What is the corresponding syntax in Oracle
0
Comment
Question by:raykata2ddotcom
4 Comments
 
LVL 3

Expert Comment

by:sachinb
ID: 7106036
A way around could be:
1. substr(name,1,1) in ('A' ,'D'  ,'X')

2. (name between 'A%' and 'D%'  or name like 'X%')

hth
sachinb
0
 

Author Comment

by:raykata2ddotcom
ID: 7106053
I guess I should have been a little more specific in my request. My particular problem is that I was hoping to combine the following condition1 or condition2

columnname like '%A5%' or columnname like '%X5%'

into 1 condition

columnname like '%[A,X]5%'

To be even more difficult, what would I use if I wanted to have either a space or a comma before the 5?
0
 
LVL 7

Accepted Solution

by:
waynezhu earned 100 total points
ID: 7106455
No, Oracle does not have the corresponding syntax that
is the traditional UNIX wildcard style. Oracle SQL
only has % and _ wildcards.

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7106586
>I was hoping to combine the following condition1 or condition2

not possible, also such
>columnname like '%[A,X]5%'
is no sql standard
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Oracle Pivot Question 8 71
constraint check 2 48
Trying connecting to SQL server 2016 from sql developer using Third Party JDBC Drivers, 2 33
update statement in oracle 9 29
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question