0

I have a column that contains the value: "Mandatory info on model l_90 with features games_14. Please provide the info for this model.[server=stack3_112] "

i want to run only the first part, "Mandatory info on model l_90 with features games_14" and exclude "Please provide info for this model" from the result.

I tried

model like '% Mandatory info on model l_90 with features games_14%'

in the select but it didn't give me what I wanted.

2
  • Tag the dbms product you use, you've already got product specific answers... Commented Oct 22, 2015 at 6:25
  • Should "Please provide info for this model" removed from all rows? (No matter if model l_90 is mentioned.) Commented Oct 22, 2015 at 6:28

3 Answers 3

1

I believe you are asking how to have only part of this column returned in your query. See:

select substr(your_column, 1, INSTR(your_column, 'Please'))
  from table
where your_column like '%Mandatory info on model l_90 with features games_14%' 

This will give you a substring of everything up until the first point it finds "Please".

Note: I'm not sure what dbms you are on but the above select will work in Oracle.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi Daniel thank you it works fine now iam able to get the expected results
Great! Please mark this as the answer to your question so others will see this as the answer if they also have the same question.
1
WHERE {column name} like '% Mandatory info on model I_90 with features games_14%
AND {column name} NOT LIKE '%Please%')

Could this work?

This way any text that contains 'please' should be filtered out

2 Comments

Thanks drzounds for your answer i tried but giving zero records
drzounds your answer helps me to work on this . i appreciate your assistance thank you
0
select 'Mandatory info on model l_90 with features games_14'
from table
where column like '%Mandatory info on model l_90 with features games_14%' 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.