November 22nd, 2012, 03:03 AM
Join Date: Nov 2012
Time spent in forums: 6 m 15 sec
Reputation Power: 0
Oracle problem with using Both OrderBy & ROwNum
I tried to make my Query as simple as possible but also it contains the problem:
,rownum as RowNumber
SELECT A.Id,A.Attachment,A.CreateDateTime,A.No FROM GOutgoingLetter A ,
SELECT B.Id, B.createdatetime as of0 FROM GOutgoingLetter B
From XCase BC, GOutgoingLetterCase BG
-- BG.CaseMechanizeState=1 And
-- And BG.RelatedCaseID=BC.Id
-- And BC.LASTEMPEXPERTMANID='EF38398F7291491898AF63AC0249DDBF'
-- OR A.RegistrarUserId = '392182A64BD5499685FFAA2E570344D9'
WHERE A.Id = B.Id
ORDER BY B.of0
the problem is :
when I use Both Order By And RowNum in my Query, Two columns of final Select Are Null: NO & Attachment. whereas this Columns aren't empty.
when I comment each one of "ORDER BY B.of0" or ",rownum as RowNumber " everything is correct!!!
what's wrong in my sql query?