MySQL
1mysql> SELECT 2 -> Quantity, 3 -> ProductID 4 -> FROM 5 -> Sales 6 -> WHERE 7 -> EmployeeID=4 8 -> INTERSECT 9 -> SELECT 10 -> Quantity, 11 -> ProductID 12 -> FROM 13 -> Sales 14 -> WHERE 15 -> CustomerID=5;> 16ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTERSECT 17SELECT 18 Quantity, 19 ProductID 20FROM 21 Sales 22WHERE 23 CustomerID=5' at line 8 24 25 26```MySQlでエラーが発生したのですが、何処の箇所でエラーが起きているのかわかりません。 27 28ご教授頂ければありがたいです。 29 30mysql> SELECT *FROM Sales; 31+--------+----------+------------+-----------+------------+------------+ 32| SaleID | Quantity | CustomerID | ProductID | EmployeeID | SaleDate | 33+--------+----------+------------+-----------+------------+------------+ 34| 1 | 5 | 3 | 21 | 19 | 2003-09-01 | 35| 2 | 1 | 20 | 14 | 4 | 2003-09-01 | 36| 3 | 1 | 20 | 9 | 4 | 2003-09-01 | 37| 4 | 6 | 15 | 22 | 6 | 2003-09-02 | 38| 5 | 2 | 21 | 20 | 22 | 2003-09-02 | 39| 6 | 3 | 22 | 17 | 25 | 2003-09-02 | 40| 7 | 24 | 17 | 40 | 5 | 2003-09-03 | 41| 8 | 12 | 17 | 20 | 5 | 2003-09-03 | 42| 9 | 10 | 1 | 2 | 17 | 2003-09-03 | 43| 10 | 1 | 5 | 6 | 19 | 2003-09-04 | 44+--------+----------+------------+-----------+------------+------------+
回答2件
あなたの回答
tips
プレビュー