sql取大的一个值
2024-10-10 11:14:40
select b.*,
a.recid,
a.keyno
from product b,
(select pcode,
keyno,
max(reccid) recid
from productstr
group by pcode, keyno) a
where b.pcode = a.pcode(+)
and b.keyno = a.keyno(+);
-------------
说明:
1.含max(reccid)等的函数,reccid不用放到group by
2.group by 中的count()不用放到select
即:select max(b.a) from b group by b.c having count(b.d)>1
最新文章
- 使用Java的Frame类编写的QQ登录界面
- Lind.DDD.Manager里菜单权限的设计
- Java中的常见面试题
- 一些PHP性能的优化
- RabbitMQ(五) -- topics
- java 附件上传时后台验证上传文件的合法性
- VBO, VAO, Generic Vertex Attribute
- React Native实例之房产搜索APP
- 慧都独家披露DevExpress v13.2测试版重大变化
- mysql 启动 导入sql文件
- poj 1383 Labyrinth
- 如何创建和发布.asmx Web Service
- 一个空格也可以让html格式显示大不相同
- 源码安装Ansible
- CSS3 3D变形效果
- HDU 1069 Monkey and Banana(DP——最大递减子序列)
- 《剑指offer》全部题目-含Java实现
- jquery实战第一讲---概述及其入门实例
- UE4中创建第一、第三人称角色,并进行角色间的切换
- error: Cannot find OpenSSL&#39;s <;evp.h>; Mac