关于ORACLE的查询分组SQL

2025-01-28 03:11:15
推荐回答(2个)
回答1:

select inq.objid as inquiryinfoid,
count(*),
wmsys.wm_concat(o.fundname) as fundnames
from otc_inquiryinfo inq,
otc_inquiryintention inqt,
otc_fund o,
otc_stockinfo stock
where stock.objid = inq.stockid
and inq.objid = inqt.inquiryinfoid
and inqt.fundkey = o.objid

group by inq.objid,stock.date
order by stock.date;

回答2:

按照inq.objid进行group by时,同一分组的date一样吗?不一样的话怎么排序