raykata2ddotcom
asked on
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
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
ASKER
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?
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>I was hoping to combine the following condition1 or condition2
not possible, also such
>columnname like '%[A,X]5%'
is no sql standard
not possible, also such
>columnname like '%[A,X]5%'
is no sql standard
1. substr(name,1,1) in ('A' ,'D' ,'X')
2. (name between 'A%' and 'D%' or name like 'X%')
hth
sachinb