我在 mysql 上运行这个查询
SELECT dranken.naam, evenement.waardeBonnetjes as drankPrijs
SUM(drankAantal1) as drankAantal from(
SELECT consumpties.aantal as drankAantal1 FROM consumpties,
drankencategorie, consumptiebezoeker
WHERE drankencategorie.idCategorie = ? and
drankencategorie.idDranken = consumptiebezoeker.idEventDrank
and consumpties.idConsumptieBezoeker = consumptiebezoeker.id
),
SUM(totaalAantalBonnetjes1) as totaalAantalBonnetjes from(
SELECT dranken.aantalBonnetjes as totaalAantalBonnetjes1 from dranken,
evenementdrank, drankencategorie
WHERE dranken.id = evenementdrank.idDrank
and evenementdrank.idEvent = ? and drankencategorie.idCategorie = ?
)
FROM
evenement
WHERE evenement.id = ? and drankencategorie.idCategorie = ?
and dranken.id = drankencategorie.idDranken
它给出了错误:每个派生表都必须有自己的别名错误
怎么了?