我想通过使用 max() 函数来获取该表的最后一条记录。
询问
select oafaci, oaorno, min(obfded) ,max(oblded) from mvxcdtpusd.oohead join mvxcdtpusd.ooline on oacono = obcono and oaorno = oborno and oafaci = obfaci and oawhlo = obwhlo where obitno like '19140%' and OBCONO = 888 group by OAFACI, OAORNO
结果
OAFACI OAORNO FDate LDate
812 0000556215 20130109 20130109
812 0000554203 20130102 20130102
812 0000553769 20121017 20121017
812 0000554204 20130130 20130130
812 0000556214 20121024 20121024
812 0000556216 20130206 20130206
从该结果表中-我想要以下数据。
愿望结果
812 0000556216 20130206 20130206
需要帮助以使用 max() 获取最后一条记录