select one.max,one.min,one.low sts,c.high ens,one.time from (
select a.max max,a.min min,b.low low,a.time time,a.aid aid from
(select max(price) max,min(price) min,time time,id aid from on_jiaoyi_into where sid=".$id."
group by DATE_FORMAT(`time`,'%Y-%m-%d') ) a LEFT JOIN
(select price low,id bid from on_jiaoyi_into where sid=".$id."
group by DATE_FORMAT(`time`,'%Y-%m-%d')
order by time ) b on a.aid=b.bid
) one LEFT JOIN
(select price high,id cid from on_jiaoyi_into where sid=".$id."
group by DATE_FORMAT(`time`,'%Y-%m-%d')
order by time desc) c on one.aid=c.cid