Oracle中用一个select查询表表中姓名和卡号问题
Oracle中用一个select查询表表中姓名和卡号,要求美金中显示2条消费最大的记录,rmb中显示两条最大的记录,改如何做呢?分别查出两条后union select name , cardnum ,rownum from tableb where bizhong = 'dollor' and rownum<=2
order by amount desc
union all
select name , cardnum ,rownum from tableb where bizhong = 'rmb' and rownum<=2
order by amount desc select * from scott.emp
scott为用户名
emp为表名 参考这篇帖子:https://blog.csdn.net/weixin_33964094/article/details/94209344
【Oracle基础】- 第8题有解析。 where加条件 参考上面的 3l的貌似可以查出来
页:
[1]