sql语句怎么写,找出每个城市的最新一条记录
答案:1 悬赏:10
解决时间 2021-01-22 03:47
- 提问者网友:遁入空寂
- 2021-01-21 21:00
sql语句怎么写,找出每个城市的最新一条记录
最佳答案
- 二级知识专家网友:一叶十三刺
- 2021-01-21 21:24
select city,max(date) from 表
group by city
追问:感谢,但是id怎么取呢
追答:selectid,city,date from 表
where (city,date) IN ( SELECt city,max(date) from 表 group by city)
试试这种 oracle有这种写法
group by city
追问:感谢,但是id怎么取呢
追答:selectid,city,date from 表
where (city,date) IN ( SELECt city,max(date) from 表 group by city)
试试这种 oracle有这种写法
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯