title: ORA-00936: missing expression distinct on oracle
body: <p>i am using oracle 10g plsql,
  my query is: </p>
  
  <pre><code>select DISTINCT ON("Rental"."pkRentalId") "pkRentalId",
      to_number("Reservation"."ReservationNo") "ReservationNo",
      to_char("Rental"."RentalNo") "RentalNo",
      to_char(segmentTable."Text"||'-'||rateTypeTable."Text") "RateType",
      to_char("Debtor"."DebtorName") "DebtorName",
      to_char("Rates"."RateName") "RateName", 
      to_char("Renter"."FirstName"||' '||"Renter"."LastName") "Renter",
      to_date("Rates"."ValidFrom") "ValidFrom",
      to_date("Rates"."ValidTo") "ValidTo",
      round(to_number(to_number("ReservationDuration"."ExpectedCheckinDateTime"-"ReservationDuration"."DispatchDateTime") *to_number("Rates"."UnitRate")),2) "RentalAmount",
      to_number("Deductions"."Amount") "Deduction",
      to_number("Billing"."DiscountAmount") "Discount"
      from "Reservation" 
      inner join "Rental" on "Rental"."pkRentalId"="Reservation"."fkRentalId"
      inner join "Rates" on "Rates"."pkRateId"="Reservation"."fkRateId"
      inner join "Renter" on "Renter"."fkReservationId"="Reservation"."pkReservationId"
      inner join "Billing" on "Billing"."pkBillingId"="Reservation"."fkBillingId"
      inner join "Deductions" on "Deductions"."fkRentalId"="Rental"."pkRentalId"
      inner join "Debtor" on "Debtor"."pkDebtorId"="Rates"."fkDebtorId"
      inner join "EnumerationValue" segmentTable on segmentTable."pkEnumerationValueId"="Reservation"."fkSegmentId"
      inner join "EnumerationValue" rateTypeTable on rateTypeTable."pkEnumerationValueId"="Reservation"."fkRateTypeId"
      inner join "ReservationDuration" on "ReservationDuration"."pkDurationLocationId"="Reservation"."fkDurationId"
      where "Reservation"."IsDeleted"='N' 
  </code></pre>
  
  <p>it is returning me :</p>
  
  <pre><code>ORA-00936: missing expression
  00936. 00000 -  "missing expression"
  *Cause:    
  *Action:
  Error at Line: 4 Column: 17
  </code></pre>
  
  <p>What is the correct format of distinct on in oracle pl/sql?  I want to return all the distinct <code>"pkRentalId"</code> values and the maximum value for all the other columns.</p>