Optimizing Oracle SQL statements - can anyone help? [message #271037] |
Fri, 28 September 2007 14:55 |
jimicron
Messages: 1 Registered: September 2007
|
Junior Member |
|
|
Hi all,
I am new to SQL but have really been trying to learn it lately and was wondering if there were more efficient ways to write these statements? I have been reading around and get a bit confused. Thanks for any help you can provide!!!
JIM
SQL Statement #1
SELECT
FUNCTIONAL_AREA, VERSION_DESCRIPTION, EXPENSE_ACCOUNT, COST_CENTER, EXPENSE, CALENDAR_MONTH_NAME
FROM
FIN_COMMON_DM.ACTUAL_EXPENSE_V
WHERE
VERSION_NAME='ACTUAL'
AND
FUNCTIONAL_AREA='R'
AND
(EXPENSE_ACCOUNT='561026'
OR
EXPENSE_ACCOUNT='539990'
OR
EXPENSE_ACCOUNT='541500'
OR
EXPENSE_ACCOUNT='541600')
AND
ORGANIZATION<>'IMFT'
SQL Statement #2
SELECT
FUNCTIONAL_AREA, VERSION_DESCRIPTION, EXPENSE_ACCOUNT_GROUP_L3, COST_CENTER, EXPENSE, CALENDAR_MONTH_NAME
FROM
FIN_COMMON_DM.ACTUAL_EXPENSE_V
WHERE
VERSION_NAME='ACTUAL'
AND
FUNCTIONAL_AREA='R'
AND
(EXPENSE_ACCOUNT_GROUP_L3='LABOR'
OR
EXPENSE_ACCOUNT_GROUP_L3='MATERIALS'
OR
EXPENSE_ACCOUNT_GROUP_L3='DEPRECIATION')
AND
ORGANIZATION<>'IMFT'
SQL Statement #3
SELECT
FUNCTIONAL_AREA, VERSION_DESCRIPTION, HEADCOUNT_GROUP_L1, COST_CENTER, HEADCOUNT, CALENDAR_MONTH_NAME
FROM
FIN_COMMON_DM.ACTUAL_HEADCOUNT_V
WHERE
FUNCTIONAL_AREA='R'
AND
VERSION_NAME='ACTUAL'
AND
HEADCOUNT_GROUP_L1='TOTAL SAP HEADCOUNT'
AND
ORGANIZATION<>'IMFT'
SQL Statement #4
SELECT
FUNCTIONAL_AREA, VERSION_DESCRIPTION, EXPENSE_ACCOUNT_GROUP_L2, COST_CENTER, EXPENSE, CALENDAR_MONTH_NAME
FROM
FIN_COMMON_DM.ACTUAL_EXPENSE_V
WHERE
VERSION_NAME='ACTUAL'
AND
FUNCTIONAL_AREA='R'
AND
EXPENSE_ACCOUNT_GROUP_L2='TOTAL EXPENSES'
AND
ORGANIZATION<>'IMFT'
SQL Statement #5
SELECT
FUNCTIONAL_AREA, VERSION_DESCRIPTION, EXPENSE_ACCOUNT_GROUP_L2, EXPENSE, CALENDAR_MONTH_NAME, ORGANIZATION
FROM
FIN_COMMON_DM.BUDGET_EXPENSE_V
WHERE
VERSION_NAME='BUDGET'
AND
EXPENSE_ACCOUNT_GROUP_L2='TOTAL EXPENSES'
AND
ORGANIZATION<>'IMFT'
AND
ORGANIZATION<>'IMFS'
|
|
|
|
|