How do I combine multiple lines for the same package? (SQL) I am doing an assignment and I am close to completing it. However the package balance appears on multiple lines and I would like to combine the balances for each package type.

IF OBJECT_ID('vwPackageRevenue') IS NOT NULL
    DROP VIEW vwPackageRevenue
GO

CREATE VIEW vwPackageRevenue
AS
SELECT (dbo.packageWH.PNAME) AS 'Package Name'
    ,(COSTPERSON * COUNT(GFirstName)) AS 'Total Revenue'
FROM dbo.packageWH
JOIN dbo.reservationWH ON dbo.packageWH.P_ID = dbo.reservationWH.P_ID
JOIN guestWH ON dbo.reservationWH.RNUM = dbo.guestWH.RNUM
GROUP BY dbo.packageWH.COSTPERSON
    ,dbo.packageWH.PNAME
    ,dbo.guestWH.GFIRSTNAME 
GO

SELECT *
FROM vwPackageRevenue


Any ideas how to complete this?
I think you just need to add a SUM and I am not sure what the &gt; signs are doing in there.

IF OBJECT_ID('vwPackageRevenue') IS NOT NULL
    DROP VIEW vwPackageRevenue
GO

CREATE VIEW vwPackageRevenue
AS
SELECT (dbo.packageWH.PNAME) AS 'Package Name'
    ,SUM((COSTPERSON * COUNT(GFirstName)))  AS 'Total Revenue'
FROM dbo.packageWH
JOIN dbo.reservationWH ON  dbo.packageWH.P_ID = dbo.reservationWH.P_ID
JOIN guestWH ON dbo.reservationWH.RNUM = dbo.guestWH.RNUM
GROUP BY 
dbo.packageWH.PNAME

GO

SELECT *
FROM vwPackageRevenue


Does this work for you?