title: Fixed Size Random Sample based on current query
body: <p>I would like to random sample 150 WORK ORDERS based on my current query and I added a SAMPLE (3), which is sampling 3%.  But every time I run the sample query the number of work order changes.  Is there a way I can just say sample 150 work orders?</p>
  
  <p>This is my current query:</p>
  
  <pre><code>SELECT  
  WORKORDER.WONUM,
  WORKORDER.PARENT,
    WORKORDER.STATUS,
    TO_CHAR(WORKORDER.REPORTDATE, 'DD-MON-YY') AS REPORTDATE,
    TO_CHAR(WORKORDER.ACTSTART, 'DD-MON-YY')   AS ACTSTART,
    TO_CHAR(WORKORDER.ACTFINISH, 'DD-MON-YY')  AS ACTFINISH,
    WORKORDER.HASCHILDREN,
    WORKORDER.ACTLABCOST,
    WORKORDER.ACTMATCOST,
    WORKORDER.ACTTOOLCOST,
    WORKORDER.WOACCEPTSCHARGES,
    WORKORDER.EXT_JOBCODE,
    WORKORDER.WORKTYPE,
    WORKORDER.DESCRIPTION,
    WORKORDER.ACTSERVCOST,
    WORKORDER.EXT_DISTWORKTYPE,
    WORKORDER.LOCATION,
    LOCATIONS.EXT_OFFICE,
    LOCATIONS.EXT_STATECODE,
    WORKORDER.OWNERGROUP,
    CASE
      WHEN LOCATIONS.EXT_SRV_POLYGON IN ('BOF', 'CDA', 'COL', 'DAV', 'GOS', 'KEL', 'KLF', 'LAG', 'LEC', 'MED', 'PUM', 'RIT', 'ROS', 'SAN', 'SPO')
      THEN
        CASE
          WHEN WORKORDER.EXT_DISTWORKTYPE IN ('EC', 'ES', 'ET')
          THEN 'WRONG POLYGON'
          ELSE 'GAS'
        END
      WHEN LOCATIONS.EXT_SRV_POLYGON IN ('CDC', 'COC', 'DAC', 'DPC', 'GRC', 'KEC', 'LCC', 'OTC', 'PAC', 'SAC', 'SPC')
      THEN
        CASE
          WHEN WORKORDER.EXT_DISTWORKTYPE IN ('GC', 'GS', 'GT')
          THEN 'WRONG POLYGON'
          ELSE 'ELECTRIC'
        END
      ELSE 'MISSING'
    END                                           AS TYPE,
    TO_CHAR(WORKORDER.SCHEDSTART, 'DD-MON-YY')    AS SCHEDSTART,
    TO_CHAR(WORKORDER.SCHEDFINISH, 'DD-MON-YY')   AS SCHEDFINISH,
    TO_CHAR(WORKORDER.TARGCOMPDATE, 'DD-MON-YY')  AS TARGCOMPDATE,
    TO_CHAR(WORKORDER.TARGSTARTDATE, 'DD-MON-YY') AS TARGSTARTDATE,
    WORKORDER.REPORTEDBY
  FROM WORKORDER
  INNER JOIN LOCATIONS
  ON WORKORDER.LOCATION   = LOCATIONS.LOCATION
  WHERE ((WORKORDER.EXT_JOBCODE NOT LIKE 'A%') AND (WORKORDER.EXT_JOBCODE NOT LIKE 'B%') OR (WORKORDER.EXT_JOBCODE IS NULL))
  AND WORKORDER.STATUS IN ('COMP', 'CLOSE') --COMMENT OUT FOR BLANKET WORKORDERS
  --AND WORKORDER.WONUM LIKE 'B%' --FOR BLANKET WORKORDERS
  AND WORKORDER.ACTFINISH &gt; '01-FEB-15'--WORKORDER COMPLETED OR CLOSED INCLUDING WOS FROM CONVERSION THAT WERE OPEN / COMMENT OUT FOR BLANKET WOS
  AND WORKORDER.SITEID = 'OPS'
  --AND WORKORDER.EXT_DISTWORKTYPE IN ('EC','GC') --Only enable this line if I am running report for Lamont's request
  --AND WORKORDER.ACTLABCOST != '0' --USED FOR TROUBLESHOOTING TO SEE LABORCOSTS ONLY
  ORDER BY WORKORDER.WONUM;
  --AND WORKORDER.EXT_JOBCODE NOT IN ('K008','K009','I006','I007','I008')--Per Rodeny not to worry about taking out these job codes since they are still being handled by gas and electric construction
  --AND TO_CHAR(WORKORDER.ACTFINISH,'MM') =  TO_CHAR(SYSDATE,'MM')-1
  --AND TO_CHAR(WORKORDER.ACTFINISH, 'YY') = TO_CH`enter code here`AR(SYSDATE,'YY')
  </code></pre>