Dear All,
 
I have a table with a varchar column that stores data in this pattern: 
 
<number><one_white_space><string><one_white_space><hyphen_symbol>
 
The pattern may be repeated upto 5 times in same cell, but the string will
be different in each case. Hence there will not be a value like this:
1 BW - 2.5 BW -
 
1 WT -  
1 BW - 1 ME -   
1 BW - 1 ME - 1.5 SY -  
1 BW -  
1 WT -  
1 OT - 2.5 WE - 
1 OT - 1 SY -   
1 WT -  
1 IT - 1 OT -   
 
I need a regular exp or any other query to fetch sum of numbers before a
string. For example the result should be 2.5 if I am searching for SY and 3
if I am searching for WT.
 
I tried a bit, but could not succeed. I am using 4.1.14-standard-log. 
 
The table is huge, hence the query should be streamlined enough.
 
Please help.
 
Thanks,
 
Ravi.

Reply via email to