SELECT
c.*
FROM chinook.invoice i
INNER JOIN chinook.customer c ON i.customer_id = c.customer_id
GROUP BY 1
HAVING SUM(i.total) > 90;
SELECT * FROM chinook.customer_gt_90_dollars; ```
What I expected to happen:
The code to run
What actually happened:
(sqlite3.OperationalError) table customer_gt_90_dollars already exists
[SQL: CREATE VIEW chinook.customer_gt_90_dollars AS SELECT c.* FROM chinook.invoice i INNER JOIN chinook.customer c ON i.customer_id = c.customer_id GROUP BY 1 HAVING SUM(i.total) > 90;]
(Background on this error at: http://sqlalche.me/e/e3q8)
<!--Enter other details below: -->
I saw a similar question regarding python not running despite a copy & pasted solution being used. I tried refreshing my page as suggested in that thread, to no avail.
Thank you. I believe this is the solution – although when I loaded up the mission today (12 hours later), I didn’t need to drop the view, I guess something rebooted after a period of inactivity. Thanks again though
I found a solution was to run the drop view and create view sequentially.:.
DROP VIEW chinook.customer_gt_90_dollars;
CREATE VIEW chinook.customer_gt_90_dollars AS
SELECT c.* FROM chinook.invoice AS I
INNER JOIN customer AS c ON c.customer_id = i.customer_id
GROUP BY c.customer_id
HAVING SUM(i.total) >90;
SELECT * FROM chinook.customer_gt_90_dollars;