這裏是我的表的Oracle SQL返回行相同的最高值
------------------
|__fruit__|_color_|
| banana | yellow|
| lemon | yellow|
| apple | red |
| cherry | red |
| lime | green |
從查詢的輸出應該是:
yellow, banana
yellow, lemon
red, apple
red, cherry
我想用的最大量返回水果顏色數。由於紅色和黃色都具有相同的最大顏色量,所以我沒有能夠得到它們兩者。 我嘗試過使用distinct
關鍵字,並嘗試使用count
不同的聚合函數,但只能返回一種顏色。
請分享你有什麼到目前爲止已經試過。 – EvilTeach