作者:
cutekid (可愛小孩子)
2014-07-01 14:38:18select t1.商品,t1.價格
from table as t1,(
select max(價格) as maxPrice from table
) as t2
where t1.價格 = t2.maxPrice
※ 引述《firerycon (不是保育類)》之銘言:
: 上學期期末考怎麼想都做不出來
: 題目要我們利用彙總函數裡面的Max和min
: 比較並顯示最貴的商品
: SELECT MAX(price)
: FROM...
: 比較之後結果只顯示最大的那個價格(數字)
: 請問我要怎麼同時抓出抓出最貴的商品(ID或名稱)和價錢並顯示出來?