|
-
Whats wrong with my query ?
SQLWKS> SELECT Exp_Work_ID AS Work_ID, Exp_Res_ID AS Res_ID, Exp_Role_ID AS Role_ID, Exp_Category AS MatCat_ID,
2> to_date(to_char(Exp_Post_Date, 'yyyymmdd'), 'yyyymmdd') AS Exp_Date,
3> mwebWork.Work_Int_Ext8 AS Company_ID,
4> Exp_reported_amount*NVL(currency.fx_rate,NVL(null_curr_date.fx_rate,1)) as Expense_Amount,
5> DECODE(Exp_Type, 10, 0 ,20, Exp_reported_amount*NVL(currency.fx_rate,NVL(null_curr_date.fx_rate,1))) as Billed_Expense
6> FROM mwebExpense, mwebwork , mwebFXRate Currency, mwebFXRate Null_Curr_Date
7> WHERE mwebExpense.Exp_Work_ID = mwebWork.Work_ID
8> AND mwebWork.Work_Currency = Currency.FX_Currency_ID (+)
9> AND mwebExpense.Exp_Post_Date >= Currency.FX_Start_Date (+)
10> AND mwebExpense.Exp_Post_Date <= Currency.FX_Finish_Date (+)
11> AND mwebWork.Work_Currency = Null_Curr_Date.FX_Currency_ID (+)
12> AND Null_Curr_Date.FX_Start_Date IS NULL
13> AND Null_Curr_Date.FX_Finish_Date IS NULL ;
AND mwebWork.Work_Currency = Currency.FX_Currency_ID (+)
*
ORA-01417: a table may be outer joined to at most one other table
Any help please, I want to show records from mwebexpense, mwebwork even if now rows returned by mwebFXRate Currency, mwebFXRate Null_Curr_Date.
Also, in the following query I am trying to get that DECODE to work -
SELECT DECODE(1, (sign(mwebRes.Res_Entity_Type - 3) and sign(mwebRes.Res_Int_Ext7-10)), ('Mgr ' + Manager.Res_Name), ' ') Manager_Name
........
........
Just like this case statement -
Select
CASE WHEN mwebRes.Res_Entity_Type = 3
AND mwebRes.Res_Int_Ext7 <> 10 THEN ('Mgr ' + Manager.Res_Name)
ELSE ' ' END as Manager_Name
Any help, please
Thanks
[Edited by sonaliak on 01-14-2002 at 03:22 PM]
Sonali
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|