0

我正在开发一个应用程序来创建图表。我有两种类型的查询。
类型 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
4

1 回答 1

2

示例代码

String s = "Adverse EventsAdverse drug reaction 56";
int number = Integer.valueOf(s.substring(s.lastIndexOf(' ')).trim());
于 2012-04-06T08:34:56.557 回答