我正在开发一个用于创建图表的应用程序。
我有两种查询。类型1仅返回一个值[Double]类型2返回多个值[Strings,Value]

我已经包括了两个样本结果


  类型1:医院死亡率
   1.7879989
    
  类型2:
  药物不良反应的数目:不良事件不良药物反应56不良事件不良药物反应67不良事件输血后反应31不良事件输血后反应32


我想将字符串和值分开。欢迎提出建议。我的查询:

SELECT WMSNAB_MAIN_DESCRIPTION MAIN,WNSNAC_DETAIL_DESCRIPTION DETAIL,
COUNT(WMSNAD_PATIENT_ID) PID
FROM WMSNAB_INCIDENT_MASTER A,WMSNAC_INCIDENT_DETAIL B,
WMSNAD_PATIENT_INCIDENTS C,WMSNAE_PAT_INCI_DET D
WHERE A.WMSNAB_MAIN_CODE       = B.WMSNAC_MAIN_CODE
AND B.WMSNAC_DETAIL_CODE     = D.WMSNAE_INCIDENT_DETAIL_CODE
AND C.WMSNAD_TRANS_ID = D.WMSNAE_TRANS_ID
AND TO_CHAR(C.WMSNAD_TRANS_DATE,'YYYY') = '2011'
AND A.WMSNAB_MAIN_CODE = 'A'
GROUP BY WMSNAB_MAIN_DESCRIPTION, WNSNAC_DETAIL_DESCRIPTION
UNION
SELECT WMSNAB_MAIN_DESCRIPTION MAIN,WNSNAC_DETAIL_DESCRIPTION DETAIL,
COUNT(WMSNAE_TRANS_ID) PID
FROM WMSNAB_INCIDENT_MASTER A,WMSNAC_INCIDENT_DETAIL B, WMSNAE_PAT_INCI_DET D
WHERE A.WMSNAB_MAIN_CODE       = B.WMSNAC_MAIN_CODE
AND B.WMSNAC_DETAIL_CODE     = D.WMSNAE_INCIDENT_DETAIL_CODE
AND TO_CHAR(D.WMSNAE_OCCURRED_DATE_TIME,'YYYY') = '2011'
AND A.WMSNAB_MAIN_CODE = 'A'
GROUP BY WMSNAB_MAIN_DESCRIPTION, WNSNAC_DETAIL_DESCRIPTION

最佳答案

样例代码

String s = "Adverse EventsAdverse drug reaction 56";
int number = Integer.valueOf(s.substring(s.lastIndexOf(' ')).trim());

07-26 01:59