SQL: combining rows using intersect and Except

Screen Link:
https://app.dataquest.io/m/190/building-and-organizing-complex-queries/6/combining-rows-using-intersect-and-except

My Code:

WITH customers_usa_gt_90 AS
     (SELECT * FROM customer_gt_90_dollars
      INTERSECT
      SELECT * FROM customer_usa)

SELECT 
    e.first_name || " " || e.last_name AS employee_name,
    COUNT(c.customer_id) AS customers_usa_gt_90,
FROM employee AS e
LEFT JOIN customers_usa_gt_90 AS c ON e.employee_id = c.support_rep_id
WHERE e.title = 'Sales Support Agent'
GROUP BY 1
ORDER BY 1;

What I expected to happen:
Nice work

What actually happened:

(sqlite3.OperationalError) near "FROM": syntax error
[SQL: WITH customer_usa_gt_90 AS      (SELECT * FROM customer_gt_90_dollars       INTERSECT       SELECT * FROM customer_usa)  SELECT      e.first_name || " " || e.last_name AS employee_name,     COUNT(c.customer_id) AS customers_usa_gt_90, FROM employee AS e LEFT JOIN customer_usa_gt_90 AS c ON e.employee_id = c.support_rep_id WHERE e.title = 'Sales Support Agent' GROUP BY 1 ORDER BY 1;]
(Background on this error at: http://sqlalche.me/e/13/e3q8)

I double check the code after “FROM” but can’t see any error…

Hi @ipngasi

There must not be a comma in front of From
Delete the “,” after customers_usa_gt_90

Regards, Max

1 Like

This is exactly right. The following was pulled from a different course: