ORACLE分组查询
发布网友
发布时间:2022-04-22 04:43
我来回答
共2个回答
热心网友
时间:2022-04-08 01:16
Easy
SELECT id, shouyi, riqi
FROM b b1
WHERE NOT EXISTS (SELECT 1 FROM b WHERE id = b1.id AND riq > b1.riqi)
热心网友
时间:2022-04-08 02:34
select id , shouyi,max(riqi) from b group by id,shouyi
或者
select id , max(shouyi),max(riqi) from b group by id,max(riqi)
分组查询要求你的所有字段必须出现在聚合函数或者group by列表中.