我的表结构是这样的:
country | price | code
---------------------------------------
EGYPT PROPER WHOLESALE | 0.037 | 20
EGYPT FIXED | 0.0710 | 20
EGYPT-OTHER | .0497 | 20
我必须使用 GROUP BY 代码,我希望输出为:
country | price | code
---------------------------------------
EGYPT PROPER WHOLESALE | 0.037 | 20
具有价格的最小值。
我的查询是:
select MIN(inp.price) as Price, inp.code, inp.country
from tbl_input_values as inp
GROUP BY code
但我得到的输出为:
country | price | code
------------------------------
EGYPT-OTHER | .037 | 20