select ccode, fprice from yourtable as A where A.ddate = (select max(ddate) from yourtable where ccode = A.ccode and bcheck = '审核')
select a.ccode,a.fprice,a.ddate from tabel a inner join (select ccode,ddate from table where bcheck =1 group by ccode,ddate )b on a.ccode=b.ccode and a.ddate=b.ddate
select * from tablename a where exists( select * from ( select ccode,max(ddate) ddate from tablename where bcheck = '1' group by ccode ) b where a.ccode = b.ccode and a.ddate = b.ddate)
select ccode(商品编号),fprice(单价),max(ddate(入库日期)),bcheck(审核) from table where bcheck(审核)=1 group by ccode(商品编号),fprice(单价),bcheck(审核)
where A.ddate =
(select max(ddate) from yourtable
where ccode = A.ccode
and bcheck = '审核')
(select ccode,ddate from table where bcheck =1 group by ccode,ddate )b
on a.ccode=b.ccode and a.ddate=b.ddate
where exists(
select * from
(
select ccode,max(ddate) ddate
from tablename
where bcheck = '1'
group by ccode
) b
where a.ccode = b.ccode and a.ddate = b.ddate)
where bcheck(审核)=1
group by ccode(商品编号),fprice(单价),bcheck(审核)