У меня есть база данных с таблицей с идентификаторами c1, c2, c3..etc..
Вместо того, чтобы писать запрос, в котором есть куча OR
, как я могу изменить приведенный ниже запрос чем-то, что будет перехватывать все записи, начинающиеся с определенной буквы?
SELECT
Person.spineinjuryAdmit,
tblComorbidity.comorbidityexplanation,
Count(tblComorbidity.comorbidityexplanation) AS CountOfcomorbidityexplanation
FROM tblKentuckyCounties
INNER JOIN (tblComorbidity
INNER JOIN (Person
INNER JOIN tblComorbidityPerson
ON Person.PersonID = tblComorbidityPerson.personID)
ON tblComorbidity.ID = tblComorbidityPerson.comorbidityFK)
ON tblKentuckyCounties.ID = Person.County
GROUP BY Person.spineinjuryAdmit,
tblComorbidity.comorbidityexplanation
HAVING (((Person.spineinjuryAdmit)="c1" Or
(Person.spineinjuryAdmit)="c2" Or
(Person.spineinjuryAdmit)="c3"));
FROM tblKentuckyCounties k
JOIN Person p ON p.County = k.ID
JOIN tblComorbidityPerson cp ON cp.personID = p.PersonID
JOIN tblComorbidity c ON c.ID = cp.comorbidityFK
- person Calvin Fisher   schedule 01.06.2011