<og:query command="{@command}" debug="{@debug}" maxRowCount="{@maxRowCount}">
	select	CLM,NAME_JA,CLS_NAME,USE_LENGTH,
			count(*) AS CNT,SYSTEM_ID,'' AS UNIQ,'1' AS FGJ
	from GF05
	where SYSTEM_ID  = '{@SYSTEM_ID}'
	and   TBLSYU     = '{@TBLSYU}'
	and   FGJ in ('0','1')
	and   CLM in (
		select CLM from (
			select	CLM,NAME_JA,CLS_NAME,USE_LENGTH
			from GF05
			where SYSTEM_ID  = '{@SYSTEM_ID}'
			and   TBLSYU     = '{@TBLSYU}'
			and   FGJ in ('0','1')
			group by NAME_JA,CLM,CLS_NAME,USE_LENGTH
		)
		group by CLM
		having count(*) > 1
	)
	group by CLM,NAME_JA,CLS_NAME,USE_LENGTH,SYSTEM_ID
	order by CLM,CNT,SYSTEM_ID
</og:query>

<og:hidden name="SQL" >
  <jsp:text>
	UPDATE GF05 SET
			NAME_JA 		= [NAME_JA],
			CLS_NAME 		= [CLS_NAME],
			USE_LENGTH 		= [USE_LENGTH],
			CDKH			= 'C',
			FGJ				= '1',
			DYUPD			= '{@USER.YMDH}',
			USRUPD			= '{@USER.ID}',
			PRGUPD			= '{@GUI.KEY}'
	WHERE SYSTEM_ID	= [SYSTEM_ID]
	AND CLM			= [CLM]
	AND TBLSYU		= '{@TBLSYU}'
	AND FGJ			IN ('0','1')
  </jsp:text>
</og:hidden>

<og:hidden name="noWritable">CNT</og:hidden>