<jsp:root
	xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:og="hybs-taglib.tld"
	version="2.0">
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8" />

<!-- 総数の順番を合わせないと、ラベルそのままの更新は上手くいかない -->
<!-- oota tmp modify DEPTNOが渡せなくなっているので、LABELNMを渡す(重複データ存在時に問題あり) -->
<og:query command="NEW" notfoundMsg=" " useBeforeHtmlTag="false" scope="request">
	--SELECT JOB LABELS
	--		,sum( case when deptno='{@DEPTNO}' then SAL else 0 end) as SAL
	--	FROM emp
	--	group by JOB
	--	order by 1
	select
		LOWER (a.JOB ) labels
		,sum(case when b.dname = '{@LABELNM}' then sal   else 0 end) as SAL
		,sum(case when b.dname = '{@LABELNM}' then empno else 0 end) as EMPNO
	from emp a
	left outer join dept b
	on a.deptno = b.deptno
	group by job
	order by 1
</og:query>

<og:view
	viewFormType	= "JSON"
	command			= "NEW"
	scope			= "request"
	useHilightRow	= "false"
	useAfterHtmlTag = "false"
	useConsistency	= "false"
	pageSize		= "1000"
/>

</jsp:root>
