我正在将两个 XML 文件读入一个数据集中。为此,我将第一个 xml 文件读入数据集,将第二个 xml 文件读入另一个数据集,然后将这两个数据集合并为一个数据集。我不确定这是否是最好和最有效的方法。
xmlFilePath = "C:\RESUSCITATION_INFUSION_DRUGS.xml"
dsInfusions_min.ReadXml(xmlFilePath)
xmlFilePath = "C:\RESUSCITATION_WEIGHT_CAT.xml"
dsWeight.ReadXml(xmlFilePath)
dsMain.Merge(dsInfusions_min.Tables(0))
dsMain.Merge(dsWeight.Tables(0))
所以现在我的 dsMain 数据集有两个表。我的问题是,如何执行一个 select 语句来连接两个表,例如下面的 select,并将结果合并到另一个数据集中?
SELECT
D.DRUG_NAME,
D.DRUG_UNITS,
D.PATIENT_WEIGHT_CATEGORY
FROM
RESUSCITATION_INFUSION_DRUGS D, RESUSCITATION_WEIGHT_CAT C
WHERE
D.PATIENT_WEIGHT_CATEGORY = C.PATIENT_WEIGHT_CATEGORY AND
15 < C.MAXIMUM_WEIGHT and
15 >= C.MINIMUM_WEIGHT
ORDER BY
D.DRUG_NAME
这是我的两个xml文件...
<?xml version='1.0' encoding='UTF-8' ?>
<RESUSCITATION_WEIGHT_CATEGORIES>
<RESUSCITATION_WEIGHT_CATEGORY>
<PATIENT_WEIGHT_CATEGORY>00</PATIENT_WEIGHT_CATEGORY>
<MINIMUM_WEIGHT>0</MINIMUM_WEIGHT>
<MAXIMUM_WEIGHT>9999</MAXIMUM_WEIGHT>
<CATEGORY_DESCRIPTION>All patients, regardless of weight. </CATEGORY_DESCRIPTION>
<UPDATED_WHEN>2003-08-20 12:00:57</UPDATED_WHEN>
</RESUSCITATION_WEIGHT_CATEGORY>
<RESUSCITATION_WEIGHT_CATEGORY>
<PATIENT_WEIGHT_CATEGORY>01</PATIENT_WEIGHT_CATEGORY>
<MINIMUM_WEIGHT>0</MINIMUM_WEIGHT>
<MAXIMUM_WEIGHT>4</MAXIMUM_WEIGHT>
<CATEGORY_DESCRIPTION>Patients less than 4 Kg.</CATEGORY_DESCRIPTION>
<UPDATED_WHEN>2003-08-20 12:01:23</UPDATED_WHEN>
</RESUSCITATION_WEIGHT_CATEGORY>
<RESUSCITATION_WEIGHT_CATEGORY>
<PATIENT_WEIGHT_CATEGORY>02</PATIENT_WEIGHT_CATEGORY>
<MINIMUM_WEIGHT>4</MINIMUM_WEIGHT>
<MAXIMUM_WEIGHT>9999</MAXIMUM_WEIGHT>
<CATEGORY_DESCRIPTION>Patients greater than 4 Kg.</CATEGORY_DESCRIPTION>
<UPDATED_WHEN>2003-08-20 12:01:52</UPDATED_WHEN>
</RESUSCITATION_WEIGHT_CATEGORY>
<RESUSCITATION_WEIGHT_CATEGORY>
<PATIENT_WEIGHT_CATEGORY>03</PATIENT_WEIGHT_CATEGORY>
<MINIMUM_WEIGHT>0</MINIMUM_WEIGHT>
<MAXIMUM_WEIGHT>5</MAXIMUM_WEIGHT>
<CATEGORY_DESCRIPTION>Patients less than 5 Kg.</CATEGORY_DESCRIPTION>
<UPDATED_WHEN>2007-10-18 13:46:43</UPDATED_WHEN>
</RESUSCITATION_WEIGHT_CATEGORY>
<RESUSCITATION_WEIGHT_CATEGORY>
<PATIENT_WEIGHT_CATEGORY>04</PATIENT_WEIGHT_CATEGORY>
<MINIMUM_WEIGHT>5</MINIMUM_WEIGHT>
<MAXIMUM_WEIGHT>9999</MAXIMUM_WEIGHT>
<CATEGORY_DESCRIPTION>Patients greater than 5 Kg.</CATEGORY_DESCRIPTION>
<UPDATED_WHEN>2007-10-18 13:47:23</UPDATED_WHEN>
</RESUSCITATION_WEIGHT_CATEGORY>
<?xml version='1.0' encoding='UTF-8' ?>
<RESUSCITATION_INFUSION_DRUGS>
<RESUSCITATION_INFUSION_DRUG>
<DRUG_NAME>DOBUTamine</DRUG_NAME>
<PATIENT_WEIGHT_CATEGORY>07</PATIENT_WEIGHT_CATEGORY>
<DRUG_CONCENTRATION>12.5</DRUG_CONCENTRATION>
<DRUG_CONCENTRATION_UNITS>mg/mL</DRUG_CONCENTRATION_UNITS>
<DOSAGE_RATE>1</DOSAGE_RATE>
<DOSAGE_RATE_UNITS>mL/h</DOSAGE_RATE_UNITS>
<DOSAGE_RATIO>2</DOSAGE_RATIO>
<DOSAGE_RATIO_UNITS>mcg/kg/min</DOSAGE_RATIO_UNITS>
<SOLUTION_PREPARATION></SOLUTION_PREPARATION>
<SOLUTION_UNITS>mg in 50 mL D5W</SOLUTION_UNITS>
<VOLUME_UNITS>mL</VOLUME_UNITS>
<SOLUTION_CONCENTRATION></SOLUTION_CONCENTRATION>
<DRUG_VOLUME></DRUG_VOLUME>
</RESUSCITATION_INFUSION_DRUG>
<RESUSCITATION_INFUSION_DRUG>
<DRUG_NAME>DOPamine</DRUG_NAME>
<PATIENT_WEIGHT_CATEGORY>03</PATIENT_WEIGHT_CATEGORY>
<DRUG_CONCENTRATION>3.2</DRUG_CONCENTRATION>
<DRUG_CONCENTRATION_UNITS>mg/mL</DRUG_CONCENTRATION_UNITS>
<DOSAGE_RATE></DOSAGE_RATE>
<DOSAGE_RATE_UNITS>mL/h</DOSAGE_RATE_UNITS>
<DOSAGE_RATIO>5</DOSAGE_RATIO>
<DOSAGE_RATIO_UNITS>mcg/kg/min</DOSAGE_RATIO_UNITS>
<SOLUTION_PREPARATION>160</SOLUTION_PREPARATION>
<SOLUTION_UNITS>mg in 50 mL D5W</SOLUTION_UNITS>
<VOLUME_UNITS>mL</VOLUME_UNITS>
<SOLUTION_CONCENTRATION>3200</SOLUTION_CONCENTRATION>
<DRUG_VOLUME></DRUG_VOLUME>
</RESUSCITATION_INFUSION_DRUG>
我想加入 PATIENT_WEIGHT_CATEGORY 字段上的两个 xml 文件。
谢谢!