Question: SQL ERROR near returning WITH total _ customers AS ( SELECT COUNT ( DISTINCT customerID ) AS total FROM JVS _ Schema.Customer ) ,
SQL ERROR near returning
WITH totalcustomers AS
SELECT COUNTDISTINCT customerID AS total
FROM JVSSchema".Customer
returningcustomers AS
SELECT COUNTDISTINCT CcustomerID AS Returning
FROM JVSSchema".Customer AS C
JOIN JVSSchema".Rental AS R ON RCustomerIDCCustomerID
JOIN JVSSchema".Order AS O ON ROrderIDOOrderID
GROUP BY CcustomerID HAVING COUNTOOrderID
SELECT returningcustomers.returning Ctotal AS retentionrate
FROM returningcustomers AS returning, totalcustomers AS total;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
