oracle中选出某个字段里面最大值的记录的sql语句怎么写

2024-11-23 12:54:13
推荐回答(1个)
回答1:

实现例句如下:销简
SELECT a.*
FROM table1 a WHERE NOT
EXISTS (SELECT 1 FROM table1 b WHERE b.id>a.id)

或者哗岩
SELECT *
FROM table1 WHERE id IN
(SELECT Max(id) FROM table1)

又亏芦裤或者
SELECT *
FROM table1 WHERE id=(SELECT Max(id) FROM table1)