Question

Locked

SQL String manipulation

By cathy.berry ·
Tags: Off Topic
I'm working with an Oracle database and have a text field of identifiers. The data I'm trying to extract is in different positions. For example:

Today = 01/11/08 and the day = Friday and it is raining
The date = 01/10/08 and the day = Thursday and we need the rain
The day after tomorrow = 01/12/08 and the day will be Monday and rain is coming

I am using INSTR to locate the beginning position for Friday, Thursday, and Monday but how do you figure out how many positions before the next ' '?

Is there something other than INSTR or can INSTR be used?

Thank you!

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

how bout 'Contains'? It does not matter where the data is.

by robo_dev In reply to SQL String manipulation

SELECT * FROM your_homework WHERE CONTAINS (your_field_name, '"Monday*" OR "Tuesday*"')

or the lazy approach

WHERE your_field_name LIKE '"%day%" '

or

WHERE CONTAINS (your_field_name, '"day*" ')

Back to After Hours Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums