Re: How to cut a field in oracle
- From: "fitzjarrell@xxxxxxx" <fitzjarrell@xxxxxxx>
- Date: 11 Jan 2006 17:11:50 -0800
balu422@xxxxxxxxx wrote:
> Hi Everyone,
>
> I am using oracle 8i and I have a table called ge_module_access which
> has a field name called functions. functions field has values like
> 'NNNNNNYNNNYNYYYY'
> 'YYYNNNYYYNNNNNYY'
> 'YYYYYYNNNNNNYYYY' etc
> each character means something is there a way I can
> cut this field in the where clause?
> select * from ge_module_access
> where first character of field functions is 'Y';
> which should bring up 2nd and 3rd record in the
> example above.
> BTW I need to cut the field instead of using like.
> Example:
> if 'YYNNYY' is function_id 1, 2 and 5, 6.
> if 'NNYYNN then funcion_id 3 and 4 and so forth....
> Any help to accomplish the task is appreciated.
> Thanks,
>
> Balu
Use SUBSTR():
substr(functions, 1, 1) = 'Y'
for example, would provide the results you want in your example.
David Fitzjarrell
.
- References:
- How to cut a field in oracle
- From: balu422
- How to cut a field in oracle
- Prev by Date: Re: Can I safely get rid of the EXAMPLE tablespace?
- Next by Date: Re: How to cut a field in oracle
- Previous by thread: How to cut a field in oracle
- Next by thread: Re: How to cut a field in oracle
- Index(es):
Relevant Pages
|