mysqlite3 でこのクエリを実行しようとすると、エラーが発生し続けます。
SELECT Region_DESC, AgeGroup, Population
(select REGION, sum(POPULATION) as Population, '0-15' AS AgeGroup
from STATS
Where Age between 0 and 15
group by REGION
union
Select REGION, SUM(POPULATION) as Population, '16-30' As AgeGroup
from STATUS
Where Age between 16 and 30
group by REGION) s
join REGION on REGION_CD = REGION
次のエラーが表示されます: Error: near "SELECT": syntax error
構文に関して、クエリに問題はありますか?