<jsp:directive.page pageEncoding="UTF-8" />
<og:query command="{@command}" debug="{@debug}" maxRowCount="0" stopZero="true" quotCheck="false" >
	select SYSTEM_ID,TBLSYU,CLM,count(*) as CNT,'' AS UNIQ,'1' AS FGJ
	from  GF05
	where SYSTEM_ID = '{@SYSTEM_ID}'
	and   TBLSYU    = '{@TBLSYU}'
	<og:where startKey="and">
		<og:and value="TABLE_NAME like '{@TABLE_NAME}%'" />
		<og:and value="CLM        like '{@CLM}%'" />
	</og:where>
	and   UPPER(CLM)  in ( {@CLMS} )
	and   FGJ       = '1'
	and   FGCOM		< '5'				-- 5:共通 は含まない。
	group by SYSTEM_ID,TBLSYU,CLM
	order by count(*) DESC , CLM
</og:query>

<og:value key="lblKey" value="C" />

<og:hidden name="names" value=",," />
<og:hidden name="SQL">
	UPDATE GF05 SET
			FGCOM	= '5',				-- 5:共通 を設定する。
			CDKH	= 'C',
			FGJ		= '1',
			DYUPD	= '{@USER.YMDH}',
			USRUPD	= '{@USER.ID}',
			PGUPD	= '{@GUI.KEY}'
	WHERE SYSTEM_ID = '{@SYSTEM_ID}'
	AND   TBLSYU    = '{@TBLSYU}'
	AND   CLM       = [CLM]
</og:hidden>
