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

<og:hidden name="SQL" >
  <jsp:text>
	UPDATE GF80 SET
			TBLSYU 			= '3',
			CLM_NAME 		= [CLM_NAME],
			CLS_NAME 		= [CLS_NAME],
			PHY_LENGTH 		= [PHY_LENGTH],
			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		= '3'
	AND FGJ			IN ('0','1')
  </jsp:text>
</og:hidden>

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