SQL Queries

Oracle Analytical Functions

The easiest way to understand analytic functions is to start by looking at aggregate functions. An aggregate function aggregates data from several rows into a single result row. The aggregate…

Read More

Get working days between two working date excluding weekends

This function which will help you to get number of working days between two date excluding the weekends. This will help other to get logic between two working date.This is…

Read More

oracle unpivot function

The Oracle UNPIVOT clause allows you to transpose columns to rows. The UNPIVOT clause is opposite to the PIVOT clause except that it does not de-aggregate data during the transposing process. It’s Very helpful when you…

Read More

Hold Pending Concurrent Requests and release them

Here is an easy way to put all the Pending Concurrent requests in hold, if we are going through any situation(Mostly any Production Cutover/Go live scenarios). 1. First create a…

Read More

Oracle R12 Query To Find Customer Notes

SELECT hca.account_number, ( SELECT hp.party_name FROM apps.hz_parties hp WHERE hp.party_id = hca.party_id ) customer_name, jnb.creation_date notes_creation_date, jnb.note_type note_type, fls.meaning note_type_meaning, jnt.notes notes FROM apps.hz_cust_accounts hca, apps.jtf_notes_b jnb, apps.jtf_notes_tl jnt, apps.fnd_lookups…

Read More

Oracle R12 GL To AR Transaction Details

SELECT DISTINCT –gcck.concatenated_segments, gcck.segment1 company, gcck.segment2 location, gcck.segment3 product, gcck.segment4 function, gcck.segment5 account, gcck.segment6 intercompany, gcck.segment7 subaccount, gcck.segment8 future1, gcck.segment9 future2, rctld.gl_date, gjb.name batch_name, gjh.name journal_name, ( SELECT user_je_category_name FROM…

Read More

Oracle R12 AR Lockbox Query

SELECT hou.name operating_unit, xep.name legal_entity, ala.lockbox_number “NUMBER”, absa.name batch_source, cebb.bank_name, –cebb.bank_number, –cebb.bank_branch_name, –cebb.bank_branch_number, –cebb.bank_branch_type, — Branch type indicates which list the bank routing number is on. Valid types are ABA,…

Read More

Oracle SQL Query To Find Square Root For A Number

Syntax: SQRT(number); Query: select SQRT(25) from dual; Output: 5

Read More

Oracle SQL Query To Find Power Of A Number

Syntax: POWER(<base number>, <exponent number>) Query: select POWER(3,3) from dual; Output: This function return base number raised to the exponent’s power. 27

Read More

Oracle SQL Query To Return Negative Numbers Within Bracket

Syntax: to_char(-123456,’99G99G99G999PR’) Query: select to_char(-123456,’99G99G99G999PR’) from dual; Output: <1,23,456>

Read More