title: ORA-00904: "%s: invalid identifier"
body: <p>Please tell me what am i doing wrong. I have entered all the correct column names still getting this error in oracle10g. I tried changing the positions too but it did not help.Any help would be much appreciated. This is the query im putting in, and the error it's giving me.</p>
  
  <pre><code>   select "RegistrationNumber",
  "Vehicle"."pkVehicleId",
  "ModelAndShapeYearSettings"."fkVehicleModelId",
  makeTable."Text" "Make",
  modelTable."Text"||' '||versionTable."Text" "Model",
  "PurchaseOrder"."IsHypothecated" "Hypothecated",
  --own."Text" "Ownership",
   "PurchaseOrder"."IsOwned" "Ownership",
  bank."Text" "OwnerName", 
  status."Text" "VehicleStatus",
  "CustomerRequisition"."Renter",
  reg."Text" "Region",
  "Branch"."BranchName" "Branch", 
  segment."Text" "Segment",
  "Debtor"."DebtorName" "Debtor", 
  case when ("Vehicle"."IsBuyBack" = 'N') then ( "ModelAndShapeYearSettings"."ResidualValue"  )
  else 
  ( "Depreciation"."Residual" )end  as "ResidualValue",
  case when ("Vehicle"."IsBuyBack" = 'N') then (  "ModelAndShapeYearSettings"."UsefulLife"   )
  else 
  ( "Depreciation"."Period"  )end  as "UsefulLife",
  "CustomerRequisition"."IsBuyBack" "BuyBack", 
  ("CustomerRequisition"."UnitPrice" +"CustomerRequisition"."Premium") "Cost", 
  to_number(("CustomerRequisition"."UnitPrice" +"CustomerRequisition"."Premium") * (1- ("Depreciation"."Residual"))) "DepreciableAmount",
  "Depreciation"."DepPerMonthCost" "DepreciationPerMonth", 
  to_number("Depreciation"."DepPerMonthCost" * "Depreciation"."Period") "AccDep",
  
  case  when ("Vehicle"."fkVehicleStatusId" = 498 or "Vehicle"."fkVehicleStatusId" = 449 or "Vehicle"."fkVehicleStatusId" = 448) and  Round(MONTHS_BETWEEN 
     ("Disposal"."DisposalDate" ,"Vehicle"."VehicleEntryDate") 
      ,0) -1 &lt; "Depreciation"."Period" and sysdate &gt; "Disposal"."DisposalDate" then ("CustomerRequisition"."Amount") - "Depreciation"."DepPerMonthCost" * (Round(MONTHS_BETWEEN 
     ("Disposal"."DisposalDate" , "Vehicle"."VehicleEntryDate")  
      ,0) )
      when ("Vehicle"."fkVehicleStatusId" = 498 or "Vehicle"."fkVehicleStatusId" = 449 or "Vehicle"."fkVehicleStatusId" = 448) and  Round(MONTHS_BETWEEN 
     ("Disposal"."DisposalDate","Vehicle"."VehicleEntryDate") 
      ,0) -1 &gt; "Depreciation"."Period" and Round(MONTHS_BETWEEN (sysdate,"Vehicle"."VehicleEntryDate") ,0) -1 &gt; "Depreciation"."Period" 
      then ("CustomerRequisition"."Amount") -"Depreciation"."DepPerMonthCost"*"Depreciation"."Period" 
      when ("Vehicle"."fkVehicleStatusId" = 498 or "Vehicle"."fkVehicleStatusId" = 449 or "Vehicle"."fkVehicleStatusId" = 448) and  Round(MONTHS_BETWEEN 
     ("Disposal"."DisposalDate" ,"Vehicle"."VehicleEntryDate") 
      ,0) -1 &lt; "Depreciation"."Period" and sysdate &lt; "Disposal"."DisposalDate" then ("CustomerRequisition"."Amount") - "Depreciation"."DepPerMonthCost" * (Round(MONTHS_BETWEEN 
     (sysdate , "Vehicle"."VehicleEntryDate")  
      ,0) )
      when ("Vehicle"."fkVehicleStatusId" = 498 or "Vehicle"."fkVehicleStatusId" = 449 or "Vehicle"."fkVehicleStatusId" = 448) and  Round(MONTHS_BETWEEN 
     ("Disposal"."DisposalDate","Vehicle"."VehicleEntryDate") 
      ,0) -1 &gt; "Depreciation"."Period" and Round(MONTHS_BETWEEN (sysdate,"Vehicle"."VehicleEntryDate") ,0) -1 &lt; "Depreciation"."Period" then ("CustomerRequisition"."Amount") -"Depreciation"."DepPerMonthCost"* (Round(MONTHS_BETWEEN 
     (sysdate , "Vehicle"."VehicleEntryDate")  
      ,0) ) 
      when ("Vehicle"."fkVehicleStatusId" != 498 and "Vehicle"."fkVehicleStatusId" != 449 and "Vehicle"."fkVehicleStatusId" != 448) and  Round(MONTHS_BETWEEN 
     (sysdate ,"Vehicle"."VehicleEntryDate") 
      ,0) -1 &lt; "Depreciation"."Period" then ("CustomerRequisition"."Amount") - "Depreciation"."DepPerMonthCost" * (Round(MONTHS_BETWEEN 
     (sysdate , "Vehicle"."VehicleEntryDate")  
      ,0) ) 
  
      when ("Vehicle"."fkVehicleStatusId" != 498 and "Vehicle"."fkVehicleStatusId" != 449 and "Vehicle"."fkVehicleStatusId" != 448) and  Round(MONTHS_BETWEEN 
     (sysdate,"Vehicle"."VehicleEntryDate") 
      ,0) -1 &gt; "Depreciation"."Period" then ("CustomerRequisition"."Amount") - "Depreciation"."DepPerMonthCost"*"Depreciation"."Period" 
  
      end as "WDV",
  --to_number("CustomerRequisition"."Amount" - ("Depreciation"."DepPerMonthCost" * "Depreciation"."Period")) "WDV" ,
  "Vehicle"."VehicleEntryDate"
  from "Vehicle" 
  inner join "EnumerationValue" modelTable on modelTable."pkEnumerationValueId"="ModelAndShapeYearSettings"."fkVehicleModelId"
  inner join "ModelAndShapeYearSettings" on "ModelAndShapeYearSettings"."fkVehicleModelId" = "Vehicle"."fkModelId"
  inner join "EnumerationValue" makeTable on makeTable."pkEnumerationValueId"=modelTable."fkParentEnumerationValueId"
  inner join "EnumerationValue" versionTable on versionTable."pkEnumerationValueId"="Vehicle"."fkVersionId"
  --left join "Ownership" on "Ownership"."fkVehicleId"="Vehicle"."pkVehicleId" 
  
  left join "EnumerationValue" status on status."pkEnumerationValueId"="Vehicle"."fkVehicleStatusId" 
  inner join "CustomerRequisition" on "CustomerRequisition"."pkCustomerRequisitionId"="Vehicle"."fkCustomerRequisitionId" 
  inner join "PurchaseOrder" on  "CustomerRequisition"."fkPurchaseOrderId" = "PurchaseOrder"."pkPurchaseOrderId"
  left join "EnumerationValue" bank on bank."pkEnumerationValueId"="PurchaseOrder"."fkBankId" 
  inner join "Branch" on "Branch"."pkBranchId"="Vehicle"."fkBranchId" 
  inner join "EnumerationValue" segment on segment."pkEnumerationValueId"="Vehicle"."fkSegmentId"  
  left join "Debtor" on "Debtor"."pkDebtorId"="CustomerRequisition"."fkDebtorId" 
  inner join "Depreciation" on "Depreciation"."fkVehicleId"="Vehicle"."pkVehicleId" 
  left join "Disposal" on "Disposal"."fkVehicleId"="Vehicle"."pkVehicleId"
  inner join "Address" on "Address"."pkAddressId"="Branch"."fkAddressId"
  inner join "EnumerationValue" city on city."pkEnumerationValueId"="Address"."fkCityId"
  inner join "EnumerationValue" reg on reg."pkEnumerationValueId"=city."fkParentEnumerationValueId"
  where "CustomerRequisition"."IsDeleted"= 'N' and "Vehicle"."IsDeleted"='N'
  
  union
  select "RegistrationNumber",
  "Vehicle"."pkVehicleId",
  makeTable."Text" "Make",
  modelTable."Text"||' '||versionTable."Text" "Model",
  'N' "Hypothecated",
  "ModelAndShapeYearSettings"."fkVehicleModelId",
   'Investor Vehicle' "Ownership",
  "Vendor"."Name" "OwnerName", 
  status."Text" "VehicleStatus",
  'N/A' "Renter",
  reg."Text" "Region",
  "Branch"."BranchName" "Branch", 
  segment."Text" "Segment",
  'Investor Vehicle' "Debtor", 
  case when ("Vehicle"."IsBuyBack" = 'N') then ( "ModelAndShapeYearSettings"."ResidualValue"  )
  else 
  ( "Depreciation"."Residual" )end  as "ResidualValue",
  case when ("Vehicle"."IsBuyBack" = 'N') then (  "ModelAndShapeYearSettings"."UsefulLife"   )
  else 
  ( "Depreciation"."Period"  )end  as "UsefulLife",
  'N/A' "BuyBack", 
  "InvestorAgreement"."Cost" "Cost", 
  0 "DepreciableAmount",
  0 "DepreciationPerMonth", 
  0 "AccDep",
  0 "WDV" ,
  "Vehicle"."VehicleEntryDate"
  from "Vehicle" 
  inner join "EnumerationValue" modelTable on modelTable."pkEnumerationValueId"="ModelAndShapeYearSettings"."fkVehicleModelId"
  inner join "ModelAndShapeYearSettings" on "ModelAndShapeYearSettings"."fkVehicleModelId" = "Vehicle"."fkModelId"
  inner join "EnumerationValue" makeTable on makeTable."pkEnumerationValueId"=modelTable."fkParentEnumerationValueId"
  inner join "EnumerationValue" versionTable on versionTable."pkEnumerationValueId"="Vehicle"."fkVersionId"
  
  left join "EnumerationValue" status on status."pkEnumerationValueId"="Vehicle"."fkVehicleStatusId" 
  inner join "InvestorAgreement" on "InvestorAgreement"."pkInvestorAgreementId"="Vehicle"."fkInvestorAgreementId" 
  inner join "Vendor" on "Vendor"."pkVendorId"= "InvestorAgreement"."fkVendorId"
  inner join "Branch" on "Branch"."pkBranchId"="Vehicle"."fkBranchId" 
  inner join "EnumerationValue" segment on segment."pkEnumerationValueId"="Vehicle"."fkSegmentId"  
  left join "Depreciation" on "Depreciation"."fkVehicleId"="Vehicle"."pkVehicleId" 
  left join "Disposal" on "Disposal"."fkVehicleId"="Vehicle"."pkVehicleId"
  inner join "Address" on "Address"."pkAddressId"="Branch"."fkAddressId"
  inner join "EnumerationValue" city on city."pkEnumerationValueId"="Address"."fkCityId"
  inner join "EnumerationValue" reg on reg."pkEnumerationValueId"=city."fkParentEnumerationValueId"
  where "InvestorAgreement"."IsDeleted"= 'N' and "Vehicle"."IsDeleted"='N';
  </code></pre>
  
  <p>ORA-00904: "ModelAndShapeYearSettings"."fkVehicleModelId": invalid identifier
  00904. 00000 -  "%s: invalid identifier"
  *Cause:<br>
  *Action:
  Error at Line: 61 Column: 76</p>