【发布时间】:2021-07-27 11:43:16
【问题描述】:
我有表products,我想创建字符串:
http://localhost/app/feeds/send?type=myType&ids=1,2,3,...,100
http://localhost/app/feeds/send?type=myType&ids=101,102,103,...,200
我创建了 sql 查询:
select concat('http://localhost/app/feeds/send?type=myType' || CHR(38) || 'ids=' , product_id) from products where isin like 'AC%' and status in
('Active', 'Created', 'Live')
and
((date>to_date('07.05.2021','dd.MM.yyyy') or date is null));
它似乎几乎是我需要的,但结果是:
http://localhost/app/feeds/send?type=myType&ids=1
http://localhost/app/feeds/send?type=myType&ids=2
http://localhost/app/feeds/send?type=myType&ids=3
如何更改此查询以返回 100 ids 和分隔符 ,?
【问题讨论】:
-
样本数据会有所帮助。
标签: sql oracle select sqlplus listagg