我有一张表,用户在dUpdateTime
上下注。
我的查询:
select * from tbet where iUserKey=53298
如何创建一个能够为我提供最新dUpdateTime
iUserKey = 53298
的查询。
答案 0 :(得分:5)
使用MAX
汇总功能
SELECT MAX(dUpdateTime) FROM tbet WHERE iUserKey = 53298
答案 1 :(得分:1)
试试这个:
select * from tbet where iUserKey=53298 order by dUpdateTime desc limit 1
答案 2 :(得分:1)
使用max aggregate函数获取最新的
SELECT MAX(dUpdateTime) FROM tbet WHERE iUserKey=53298