读书人

取出一个表的最小值 同时 取出 最小值

发布时间: 2012-02-02 23:57:14 作者: rapoo

取出一个表的最小值 同时 取出 最小值的日期 是怎样写 sql
SELECT min(price) as price , date from a_price

取出一个表的最小值 同时 取出 最小值的日期 是怎样写 sql
上面好像不对

[解决办法]

SQL code
select price,`date`from a_price twhere not exists(select 1 from a_price where price<t.price)
[解决办法]
SQL code
select price,`date` from  a_price order by price limit 1
[解决办法]
探讨
SQL code
select price,`date`
from a_price t
where not exists(select 1 from a_price where price<t.price)

读书人网 >Mysql

热点推荐