Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
vignesh_s
Creator
Creator

joins

i have a table1 ,i want Max(NAV_ID) such that,say i have Date=1/11/12 Fundid=99,NAV_ID=2 and Date=1/11//12 fundid=99,NAV_ID=3

,i want to diaplay only the NAV_ID=3,Date=1/11//12 fundid=99 followe by other fields(A,B,C,D....) w.r.t to NAV_ID

i tried load resident to achive ths and i left joined with load table ,i did not got the result properly

table1:

load

Date, FundID,  NAV_ID,A,B,C,D,E,F;

7 Replies
Anonymous
Not applicable

try

Load Date, FundID,  A,B,C,D,E,F
max(NAV_ID)
group by Date, FundID,  A,B,C,D,E,F
Anil_Babu_Samineni

I don't think where Max() won't work direct load. You could use something like Left / Right join to deserve

Table1:

Load Date, FundID,  A,B,C,D,E,F From Table1;

Right Join (Table1)

Load Date, max(NAV_ID) Resident Table1 group by Date;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable

absolutely right your solution

vignesh_s
Creator
Creator
Author

i used right join but ,whn i compare the result with xsl file the value is wrong

test.png

d_prashanthredd
Creator III
Creator III

Hi Vignesh,

What you compared and what is wrong in that?

Anil's solution gonna work fine and the sollution was to identify the max NAV_ID.

If you can specify the problem clearly, anyone can provide you the correct solution.

vignesh_s
Creator
Creator
Author

tanks i got solution

Anil_Babu_Samineni

You need to understand the Decimal concept using Num()..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful