Monday, 20 June 2016

Category wise Min and Max Document Sequence Values PLSQL Query- Oracle EBS R12

http://generalledger-gl.blogspot.com/2016/06/select-glc.html

Category wise Min and Max Document Sequence Values PLSQL Query

select glc.user_je_category_name, min(gjh.DOC_SEQUENCE_VALUE) from gl_je_headers gjh, gl_je_categories glc
where glc.je_category_name=gjh.JE_CATEGORY --151763
and gjh.DEFAULT_EFFECTIVE_DATE between '01-JUL-2015' and '31-MAY-2016'
and gjh.ACTUAL_FLAG='A'
and gjh.LEDGER_ID=20
group by glc.user_je_category_name, min(gjh.DOC_SEQUENCE_VALUE)

------------------

Main Query

select glc.user_je_category_name,min(gjh.DOC_SEQUENCE_VALUE),max(gjh.DOC_SEQUENCE_VALUE)
from gl_je_headers gjh, gl_je_categories glc
where 1=1
and glc.je_category_name=gjh.JE_CATEGORY
and gjh.DEFAULT_EFFECTIVE_DATE between '01-JUL-2015' and '31-MAY-2016'
and gjh.ACTUAL_FLAG='A'
and gjh.LEDGER_ID=20
group by glc.user_je_category_name

-------------------

select gjh.DOC_SEQUENCE_VALUE
from gl_je_headers gjh, gl_je_categories glc
where 1=1
and glc.je_category_name=gjh.JE_CATEGORY
and gjh.DEFAULT_EFFECTIVE_DATE between '01-JUL-2015' and '31-MAY-2016'
and gjh.ACTUAL_FLAG='A'
and gjh.LEDGER_ID=20
and glc.user_je_category_name='Purchase Invoices'
order by gjh.DOC_SEQUENCE_VALUE

1 comment: