Table: Sales
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| seller_id | int |
| product_id | int |
| buyer_id | int |
| sale_date | date |
| quantity | int |
| price | int |
+-------------+---------+
WITH temp AS
(SELECT seller_id, SUM(price) AS sum_price FROM Sales GROUP BY seller_id)
SELECT A.seller_id FROM temp A, temp B
WHERE A.sum_price >= ALL(SELECT sum_price FROM B);
When I run this code, I get the following error message:
Table 'test.b' doesn't exist
But I am not sure what I did wrong. Can someone help please? Thanks.