GO CREATE VIEW vwPaymentSummary AS SELECT COUNT(BookingID) AS TotalBookings, CONCAT(FirstName, ' ', LastName) AS CustomerFullName, CustomerEmail, CustomerPhone,
Fantastic news! We've Found the answer you've been seeking!
Question:
GO CREATE VIEW vwPaymentSummary AS SELECT COUNT(BookingID) AS TotalBookings, CONCAT(FirstName, ' ', LastName) AS CustomerFullName, CustomerEmail, CustomerPhone, StartDate, EndDate, DATEDIFF(dd, StartDate, EndDate) * Rate AS FullAmount, SUM(DATEDIFF(dd, StartDate, EndDate)) AS TotalPayments FROM Booking AS b JOIN Customer AS c ON b.CustomerID = c.CustomerID;
Msg 8120, Level 16, State 1, Procedure vwPaymentSummary, Line 2 [Batch Start Line 29] Column 'Customer.FirstName' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. Msg 8120, Level 16, State 1, Procedure vwPaymentSummary, Line 2 [Batch Start Line 29] Column 'Customer.LastName' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
How do i fix the errors?
Related Book For
Business Law Text and Cases
ISBN: 978-0324655223
11th Edition
Authors: Kenneth W. Clarkson, Roger LeRoy Miller, Gaylord A. Jentz, F
Posted Date: