Hi All,
I have some more detail on the ealier Outer Join questions. angiole and rudy, both have helped before I hope they can again. Again I am currently using Sybase Adaptive Server Enterprise 11.9 but moving to 12.5.
I have two queries that are supposed to display the same results; however, The first query displays multiple rows of values which are not correct. The second query displays the correct ONE row output. This kind of explains why the programmer decided to go with the Anti-standard apporach. Can anyone figure out why and can the make the first query display the same one row output?
Select A.LoanKeyNum,A.PrinBalAmt,
B.NMLLoanInvNum ,LoanMsrDte, max(LoanMsrDte)
From elmo..LoanMeasure A, elmo..Loan B
Where ( A.LoanKeyNum = B.LoanKeyNum )
And B.LoanKeyNum = 400
Group By A.LoanKeyNum
Having ( LoanMsrDte = max(LoanMsrDte) )
Order By B.NMLLoanInvNum
Select A.LoanKeyNum,A.PrinBalAmt,
B.NMLLoanInvNum ,LoanMsrDte, max(LoanMsrDte)
From elmo..LoanMeasure A, elmo..Loan B
Where ( A.LoanKeyNum = B.LoanKeyNum )
Group By A.LoanKeyNum
Having ( LoanMsrDte = max(LoanMsrDte) )
And ( A.LoanKeyNum = B.LoanKeyNum )
And B.LoanKeyNum = 400
Order By B.NMLLoanInvNum
I have some more detail on the ealier Outer Join questions. angiole and rudy, both have helped before I hope they can again. Again I am currently using Sybase Adaptive Server Enterprise 11.9 but moving to 12.5.
I have two queries that are supposed to display the same results; however, The first query displays multiple rows of values which are not correct. The second query displays the correct ONE row output. This kind of explains why the programmer decided to go with the Anti-standard apporach. Can anyone figure out why and can the make the first query display the same one row output?
Select A.LoanKeyNum,A.PrinBalAmt,
B.NMLLoanInvNum ,LoanMsrDte, max(LoanMsrDte)
From elmo..LoanMeasure A, elmo..Loan B
Where ( A.LoanKeyNum = B.LoanKeyNum )
And B.LoanKeyNum = 400
Group By A.LoanKeyNum
Having ( LoanMsrDte = max(LoanMsrDte) )
Order By B.NMLLoanInvNum
Select A.LoanKeyNum,A.PrinBalAmt,
B.NMLLoanInvNum ,LoanMsrDte, max(LoanMsrDte)
From elmo..LoanMeasure A, elmo..Loan B
Where ( A.LoanKeyNum = B.LoanKeyNum )
Group By A.LoanKeyNum
Having ( LoanMsrDte = max(LoanMsrDte) )
And ( A.LoanKeyNum = B.LoanKeyNum )
And B.LoanKeyNum = 400
Order By B.NMLLoanInvNum