<og:query command="{@command}" debug="{@debug}" maxRowCount="10000" stopZero="true">
	select	CLM,NAME_JA,BIKO,
			count(*) AS CNT,SYSTEM_ID,'' AS UNIQ,'1' AS FGJ
			, LISTAGG(TABLE_NAME, ', ') WITHIN GROUP (ORDER BY TABLE_NAME, TABLE_NAME) as TABLE_NAME
	from GF05
	where SYSTEM_ID  = '{@SYSTEM_ID}'
	and   TBLSYU     = '{@TBLSYU}'
	and   FGCOM     != '9'
	and   FGJ in ('0','1')
	and   CLM in (
		select CLM from (
			select	CLM
			from GF05
			where SYSTEM_ID  = '{@SYSTEM_ID}'
			and   TBLSYU     = '{@TBLSYU}'
			and   FGCOM     != '9'
			and   FGJ in ('0','1')
			group by CLM,BIKO
		) B
		group by CLM
		having count(*) > 1
	)
	group by CLM,NAME_JA,BIKO,SYSTEM_ID
	order by CLM,NAME_JA,BIKO,SYSTEM_ID
</og:query>

<og:hidden name="SQL" >
	UPDATE GF05 SET
			BIKO	 		= [BIKO],
			CDKH			= 'C',
			FGJ				= '1',
			DYUPD			= '{@USER.YMDH}',
			USRUPD			= '{@USER.ID}',
			PGUPD			= '{@GUI.KEY}'
	WHERE SYSTEM_ID	= [SYSTEM_ID]
	AND CLM			= [CLM]
	AND TBLSYU		= '{@TBLSYU}'
	AND FGCOM		!= '9'
	AND FGJ			IN ('0','1')
</og:hidden>

<og:hidden name="noWritable">SYSTEM_ID,CLM,CNT,TABLE_NAME</og:hidden>