SELECT "region", sum("items"), sum("actcost")
FROM "apr","Regions"
WHERE "bnfname" LIKE 'Flucloxacillin %' AND apr.sha=Regions.sha
GROUP BY "region"

出现以下错误:
错误:缺少表“regions”的FROM子句项

最佳答案

试试这个:

SELECT "region", sum("items"), sum("actcost")
FROM "apr","Regions"
WHERE "bnfname" LIKE 'Flucloxacillin %' AND "apr"."sha"="Regions"."sha"
GROUP BY "region"

10-08 03:20