[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2742
  • Last Modified:

Oracle WildCards

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
raykata2ddotcom
Asked:
raykata2ddotcom
1 Solution
 
sachinbCommented:
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
 
raykata2ddotcomAuthor Commented:
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
 
waynezhuCommented:
No, Oracle does not have the corresponding syntax that
is the traditional UNIX wildcard style. Oracle SQL
only has % and _ wildcards.

0
 
kretzschmarCommented:
>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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now