Question: ERROR: syntax error at or near Returning LINE 9 : SELECT ( Returning / total ) * 1 0 0 AS retention _ rate FROM
ERROR: syntax error at or near "Returning"
LINE : SELECT Returning total AS retentionrate FROM retu...
SQL state:
Character:
syntax Error
WITH total
customers AS
SELECT COUNT
DISTINCT customerID
AS total
FROM
JVS
Schema".Customer
returning
customers AS
SELECT COUNT
DISTINCT C
customerID
AS Returning
FROM
JVS
Schema".Customer AS C
JOIN
JVS
Schema".Rental AS R ON R
CustomerID
C
CustomerID
JOIN
JVS
Schema".Order AS O ON R
OrderID
O
OrderID
GROUP BY C
customerID HAVING COUNT
O
OrderID
SELECT
C
returning
C
total
AS retention
rate
FROM returning
customers AS Return, total
customers 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
