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 9: SELECT (Returning / total)*100 AS retention_rate FROM retu...
SQL state: 42601
Character: 391
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
)
>
1
)
,
SELECT
(
C
.
returning
/
C
.
total
)
*
1
0
0
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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!