?
Solved

Oracle WildCards

Posted on 2002-06-24
4
Medium Priority
?
2,709 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 300 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
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…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

719 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