📜  sql select min - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:35.751000             🧑  作者: Mango

代码示例1
-- This gives you the customer name and balance for
-- the customer with the lowest balance.

select CustomerName, Balance -- start your query as normal
from Customers
where Balance = ( -- now when specifying where, you do another query
  select MIN(Balance) -- where you select the lowest balance
  from Customers
);