就是想在合同列表中查找到每一个客户的最后一份合同。麻烦大神们帮忙指导一下,非常感谢
一、内建库视图成功:
SELECT MAX("结束日期"),"信用代码"
FROM "代账合同"
group BY "信用代码"
order BY "结束日期"
二、外建库视图失败:
select MAX(`代账合同`.`结束日期` AS `结束日期`) ,`代账合同`.`信用代码` AS `信用代码`from `代账合同`group BY `代账合同`.`信用代码` AS `信用代码`order BY `代账合同`.`结束日期` AS `结束日期`
|