-1
我正在試圖查詢以查找從下表中訂購了最大數量的產品的客戶!選擇訂購了最大數量產品的客戶?
mysql> select * from ORDERS;
+---------+---------+------------+-----+
| CUSTNUM | PRODNUM | DATE | QTY |
+---------+---------+------------+-----+
| 125216 | 2323 | 2016-03-21 | 2 |
| 136101 | 2357 | 2016-03-21 | 5 |
| 136101 | 2357 | 2016-10-12 | 1 |
| 136101 | 2357 | 2016-11-25 | 5 |
| 136101 | 3737 | 2016-10-12 | 10 |
| 136101 | 9193 | 2016-11-25 | 5 |
| 182764 | 2357 | 2015-03-21 | 12 |
| 182764 | 2357 | 2016-05-12 | 10 |
| 212836 | 3737 | 2015-09-16 | 6 |
| 455566 | 4143 | 2016-02-09 | 10 |
| 455566 | 4143 | 2016-05-12 | 10 |
+---------+---------+------------+-----+
預期的結果事先求助
+-------------+------------------+
| CUSTNUM | quantity_ordered |
+-------------+------------------+
| 136101 | 26 |
+-------------+------------------+
感謝。
這是關於MySQL的基礎知識...'-1' –
很容易讓你也許,但我試圖從4小時沒有運氣 –
'選擇*,最大(數量)從ORDERS' – katu