機能に問題がありLISTAGG
ます。エラーORA-00937: not a single group functionが発生し続けます。このエラーをグーグルで検索しましたが、何が問題なのかまだはっきりしていません。
シナリオ: セグメントのテーブルがあります。セグメントには複数の人を割り当てることができます (1 対多)。1 つの列にセグメント番号を表示し、もう 1 つの列にユーザーのリストを表示するには、出力/レポートが必要です。
クエリ:
select fcs.nld_flood_control_segment_id
, fcs.fc_segment_name
, fcs.fc_segment_abbrev_name
, LISTAGG(ps.first_name|| ' ' ||ps.last_name, ', ') within group (ORDER BY fcs.nld_flood_control_segment_id, ps.last_name) "ListOfReps"
from nld_flood_control_segments fcs
, nld_fc_segment_person_xref xr
, persons ps
where fcs.nld_flood_control_segment_id = :P1_id
and :P1_id = xr.nld_flood_control_segment_id
and xr.person_id = ps.person_id
order by nld_flood_control_segment_id asc
;
どんな助けでも大歓迎です。前もって感謝します。