#6197·leetcode

Bug Report for sql-common-table-expressions

Author: amitananddotxyzCreated Sep 21, 2026Updated Sep 21, 2026

Bug Report for https://neetcode.io/problems/sql-common-table-expressions

Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.

The following solution is also accepted which is incorrect. One of the test cases should fail. when a customer has ordered an item of say 120 then it should not be included but it will if i use the following solution

WITH price_less_than_hundred_orders AS ( SELECT customer_id FROM orders WHERE price < 100 )

SELECT name FROM Customers c JOIN price_less_than_hundred_orders pltho ON c.id = pltho.customer_id ORDER BY name ASC;