老大们睡午觉呢? 我来回答看看SELECT * FROM table_name WHERE date=(SELECT MAX(date) from table_name)
select A.date,A.productID,table.detailID from table, (select max(date) as date,productID from table group by productID ) As A where table.productID=A.productID and A.date=table.date
select ReleaseDate,productID,quantity from TB_OrderReleases as a,TB_OrderReleaseDetails as b where a.orderReleaseID=b.orderReleaseID and not exists(select 1 from TB_OrderReleaseDetails as c where b.ReleaseDate<c.ReleaseDate and a.orderReleaseID=c.orderReleaseID)
select * from tb t where not exists(select 1 from tb where productID=t.productID and detailID>t.detailID)
我来回答看看SELECT * FROM table_name
WHERE date=(SELECT MAX(date) from table_name)
from table,
(select max(date) as date,productID
from table
group by productID
) As A
where table.productID=A.productID
and A.date=table.date
where a.orderReleaseID=b.orderReleaseID
and not exists(select 1 from TB_OrderReleaseDetails as c where b.ReleaseDate<c.ReleaseDate and a.orderReleaseID=c.orderReleaseID)