Jump to content

Sam@11

Members
  • Content count

    10
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Sam@11

  • Rank
    Member
  1. @boobalganesan Hello boobal with t1 as (select 'A+++500+read++' col1 from dual) select regexp_count(substr(col1,1,regexp_instr(col1,'[^\+]+',1,regexp_count(col1,'[^\+]+'))-1),'\+') from t1; This queyr you gave for finding total count of '+' before last value..Here last value is 'read'.So with this query i got total count of '+' before 'read' as 4 which is absolutely right. It was a sample data which i provided u.But in my table data is like this.. '20005465+Mr.++++Delhi+0+Pune When i am running the same query for 'dual',then it works.But when i m running the same query for my real table,then i get error.:-''0 out of range''. Whats solution for this??Due to 0,query is not working.
  2. @boobalganesan You are right boobal.Output will be 1,4,5..For that i have built a procedure & got the result.
  3. @boobalganesan Hello boobal Here we have to take count of '+' before each value...Before 'A',1 '+' is there,so it will give 1,before '500',total 4 '+' is there from sarting means including '+' before 'A' also,then total count of '+' before '500' will be 4 and total count of '+' before 'read' will be 5 which will include '+' before '500' also & '+' before 'A' also...means count of '+' before each value starting from the start. Then output will be 1,3,5
  4. @boobalganesan Thanks boobal for you are response. Bt here 1,5,9 i m getting.I want the position of each value means at which position of '+',value occurs or in other words count of '+' before each value.Here data is 'A+++500+read++'...now i add one more '+' before 'A'..now data looks like '+A+++500+read++'.Now i want count of '+' before each value.Here 3 values namely 'A','500',read' is there.Now i want output as 1,3,5. A+++500+read++
  5. @boobalganesan Kindly Help..
  6. @boobalganesan One more thing i wna ask,if for the same data A+++500+read++ ,i want to capture position for each value means at which '+' postion value occurs or in other words count of '+' before each value,what should i do?? In this data,for 'A',position should be 0,for '500' position should be 3,for 'read,it should be 4.Output should be 0,3,4.Or i concatenate +||A+++500+read++ and then find count of '+' before each value and get that output as 1,4,5.What should be the query for this?
  7. Hello Ganesan

     

    Thanks for your response..One more requirement is there n i need you are help..

  8. @boobalganesan Hello Ganesan Thanks for your solution.Both is working fine according to my need. One more thing i wna ask,if for the same data A+++500+read++ ,i want to capture position for each value means at which '+' postion value occurs or in other words count of '+' before each value,what should i do?? In this data,for 'A',position should be 0,for '500' position should be 3,for 'read,it should be 4.Output should be 0,3,4.Or i concatenate +||A+++500+read++ and then find count of '+' before each value and get that output as 1,4,5.What should be the query for this?
  9. @boobalganesan Hello Boobal Here 3rd value is 'read' bt its not like that we will always get 'read' value only..We can get different values. Just like A++++++USA+ A+++++++London+++++Newyork In every case,occurence of last '+' at which value occurs is needed.Here just for sample,i gave last value 'read' but last values can be different. & in second case bettween two '+',even if .(dot) occurs just like A+++++.++,we have to consider .(dot) as value.Anythng apart from '+' will be considered as value..
  10. A+++500+read++ I want the occurence of last '+' or in other words,total count of '+' before last value 'read' through PL/SQL at which value occurs.First value is 'A',Second value is '500' , third value is 'read'.Here last value is 'read' and position of '+' at which last value 'read' occurs is 4.I want this output 4 through query.Just want occurence of Highlighted '+' or in other words,total count of '+' before last value 'read'.Max position of '+' at which last value is there.Here output should be 4. Second i want total number of values that occurs between '+'..Here three values namely A,500,read is there.I want count of values means how many values exist between '+'.Output should be 3.
×