以上是我的查询的输出。我想按字母顺序排列排放类型,同时将地铁、阿巴拉契亚和农村TRUES
组合在一起,即地铁、农村和阿巴拉契亚的所有 1 的顺序正确,但我如何按字母顺序排列第一列。以下是我的查询
SELECT tblDischarge.dischargeType, COUNT(tblDischarge.dischargeType) AS counts, tblVisits.diabetes, tblVisits.hemiplegia, tblKentuckyCounties.Metro,
tblKentuckyCounties.Appalachia, tblKentuckyCounties.Rural
FROM tblKentuckyCounties INNER JOIN
tblVisits ON tblKentuckyCounties.countyID = tblVisits.countyID INNER JOIN
tblDischarge ON tblVisits.DischargeStatus = tblDischarge.dis_statID
WHERE (tblVisits.diabetes = 1) AND (tblVisits.hemiplegia = 1)
GROUP BY tblDischarge.dischargeType, tblVisits.diabetes, tblVisits.hemiplegia, tblKentuckyCounties.Metro, tblKentuckyCounties.Appalachia, tblKentuckyCounties.Rural
HAVING (tblDischarge.dischargeType LIKE '%routine%') OR
(tblDischarge.dischargeType LIKE '%short-term%') OR
(tblDischarge.dischargeType LIKE '%icf%') OR
(tblDischarge.dischargeType = 'home health') OR
(tblDischarge.dischargeType LIKE '%swing%') OR
(tblDischarge.dischargeType LIKE 'rehab%') OR
(tblDischarge.dischargeType LIKE '%long-term%')
ORDER BY tblKentuckyCounties.Appalachia, tblKentuckyCounties.Rural, tblKentuckyCounties.Metro