34,594
社区成员
发帖
与我相关
我的任务
分享
select a.公司名称,a.公司编号,b.信息标题,b.信息编号
from table1 a,table2 b,
(select 公司编号,min(排序字段) 排序字段 from table2 group by 公司编号) c
where a.公司编号=b.公司编号 and b.公司编号=c.公司编号 and b.排序字段=c.排序字段
public static void main
select
a.公司名称,a.公司编号,b.信息标题,b.信息编号
from
table1 a,
table2 b
where
a.公司编号=b.公司编号
and
b.排序字段=(select max(排序字段) from table2 where 公司编号=a.公司编号)