【发布时间】:2018-11-13 03:11:45
【问题描述】:
select shipment_stop_d.shipment_gid,count(s_ship_unit_line.s_ship_unit_gid)
from s_ship_unit_line,shipment_stop_d
where shipment_stop_d.shipment_gid is not null
and count(s_ship_unit_line.s_ship_unit_gid) > 200
group by s_ship_unit_line.s_ship_unit_gid;
我需要的条件是在表s_ship_unit_line 中有多少个{(s_ship_unit_line.s_ship_unit_gid)} 的计数超过200 对于表shipment_gid 在表shipment_stop_d 中的shipment_gid
【问题讨论】:
-
s_ship_unit_line和shipment_stop_d是什么关系?如所写,此查询会将s_ship_unit_line中的每一行连接到shipment_stop_d中的每一行,即笛卡尔连接。 ???
标签: sql oracle oracle11g group-by aggregate-functions