我有下面的查询,可以正常工作。如何修改此查询以将记录插入下表。
with loop1(tour_id) as (select level from
dual connect by level <= 10)
,loop2(b) as (select level from dual connect by level <= 7)
SELECT tour_id,
'Tour ' || tour_id AS tour_name,
replace(listagg(CASE round(dbms_random.value(1,2))
WHEN 1 THEN 'Y'
WHEN 2 THEN 'N'
END,',')
within group (order by b)
,',') AS active_days
FROM loop1
cross join loop2
group by tour_id
create table tour_hdr(
tour_id NUMBER(4),
tour_name VARCHAR2(20),
active_days VARCHAR2(7)
)
1条答案
按热度按时间mec1mxoz1#
如何将此查询修改为
INSERT
记录到下表?这样地: