<html style="direction: ltr;">
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
    <style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
  </head>
  <body style="direction: ltr;"
    bidimailui-detected-decoding-type="latin-charset" bgcolor="#FFFFFF"
    text="#000000">
    How about a spatial DB solution?<br>
    This query in Spatialite will do what you asked. <br>
    <br>
    SELECT pk_uid<br>
    FROM points <br>
    WHERE pk_uid in (<br>
        SELECT points.pk_uid<br>
        FROM points JOIN polys <br>
        ON ST_Intersects(points.geometry, polys.geometry)<br>
        GROUP BY polys.pk_uid)<br>
    <br>
    Although when you say "select randomly" I have to think twice. Do
    you mean that you want to rerun this selection and get a different
    random point each time? The above will NOT do that.<br>
    <br>
    <div class="moz-cite-prefix">On 05/09/2015 03:30 PM, Juan Miguel
      Requena wrote:<br>
    </div>
    <blockquote
cite="mid:CAHDzixBoBoCJm9HegahL9+nKYbak3kxvxQ6iwSS_a3oKCoYPig@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Hello, I have two vectors, points and polygons. I need to
          select randomly one only point from each polygon. Any idea?
          Thank very much in advance.</div>
        <div><br>
        </div>
        <div>All the best</div>
        <div><br>
        </div>
        <div>Juan Miguel</div>
      </div>
      <br>
      This mail was received via Mail-SeCure System.<br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a>
This mail was received via Mail-SeCure System.


</pre>
    </blockquote>
    <br>
  </body>
</html>