我想知道如何将此 SQL 语句转换为 JPQL:
SELECT sum(price) AS Income, count(*) AS Passages, Station.Name
FROM Passage
INNER JOIN station ON passage.stationId = station.id
GROUP BY Station.Name
会不会是这样的:
SELECT sum(price) AS Income, count(p) AS Passages, s.Name FROM Passage p
INNER JOIN station s
ON p.stationId = s.id GROUP BY s.Name
?