关于一个sql问题啊,其实也不是很难,只是本人太菜啦
一张信用卡申请分期付款的记录表,那里有自己的证件号,卡号,申请时间.
这张表里存放着申请的所有记录,如何查询出自己申请的最新的那一条记录(这个卡可能申请过很多次)
[解决办法]
max(申请时间)
[解决办法]
select * from table where time = (select max(time) from table where user='youName') and user = 'youName';
[解决办法]
排个序 取第一条 不就行了
[解决办法]
select * from (select * from table where user='youName' order by time desc) where rownum = 1