Solved

Oracle WildCards

Posted on 2002-06-24
4
2,660 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.

Join & Write a Comment

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now