Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

wildcard queries

539506Apr 27 2007 — edited Apr 27 2007
I am trying to do a simple query where I select from one table.


I need to select vins and they are 17 digit vins.


so I need to select where vin position 8 is either an:

'Z', 'K', 0, 3, 'W'

well I'm able to do that with a simple like query.


select * from vehicle where
vin like (('_______Z_________')
or .... etc etc....

but here is my struggle.

I need to select those based on the 8th position of the vin and then I need to select based on each of those where the 3rd position is either a number or a letter.


e.g

select * from vehicle
where vin like ('_______Z_________')
and vin like ('__X______________')

where X is the wildcard which restricts it to either a number or a letter.


Is there a wildcard in oracle sql for just numbers or just letters.

I really don't want to write out all 10 digits from 0 to 9 and all letters from A to Z.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2007
Added on Apr 27 2007
5 comments
400 views