字符串分割问题
有张表,里面有这样一些记录,如果找出其中的计量单位。
0.4-4.6 pg/mL
<125 pg/mL
<15 ??ol/L
0.8-2.0 ng/mL
5.1-14.1 ??/dL
2.0-4.4 pg/mL
0.93-1.7 ng/dL
0.27-4.2 ??U/mL
98 - 107 mmol/L
22 - 29 mmol/L
60-117 mg/dL-females
66-133 mg/dL males
找出,pg/ml,ng/ml,mg/dL and etc
[解决办法]
为什么不适应?
mg/dL-females取是要什么?mg/dL?
[解决办法]
修正:
- SQL code
create table tb(jldw nvarchar(20))insert into tb select '0.4-4.6 pg/mL'insert into tb select '<125 pg/mL'insert into tb select '<15 ??ol/L'insert into tb select '0.8-2.0 ng/mL'insert into tb select '5.1-14.1 ??/dL'insert into tb select '2.0-4.4 pg/mL'insert into tb select '0.93-1.7 ng/dL'insert into tb select '0.27-4.2 ??U/mL'insert into tb select '98 - 107 mmol/L'insert into tb select '22 - 29 mmol/L'insert into tb select '60-117 mg/dL-females'insert into tb select '66-133 mg/dL males'goselect distinct * from(select right(jldw,charindex(' ',REVERSE(jldw))-1)jldw from tb)t where charindex('?',jldw)=0 and charindex('-',jldw)=0 and charindex('/',jldw)>0/*jldw--------------------mmol/Lng/dLng/mLpg/mL(4 行受影响)*/godrop table tb