Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 9550D9FB309 for ; Fri, 27 Jul 2007 04:48:47 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 85156-09 for ; Fri, 27 Jul 2007 04:48:41 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from fmmailgate04.web.de (fmmailgate04.web.de [217.72.192.242]) by postgresql.org (Postfix) with ESMTP id C53989FB357 for ; Fri, 27 Jul 2007 04:48:43 -0300 (ADT) Received: from web.de by fmmailgate04.web.de (Postfix) with SMTP id 071F32B517B4 for ; Fri, 27 Jul 2007 09:48:42 +0200 (CEST) Received: from [213.187.89.34] by freemailng2701.web.de with HTTP; Fri, 27 Jul 2007 09:48:41 +0200 Date: Fri, 27 Jul 2007 09:48:41 +0200 Message-Id: <156384696@web.de> MIME-Version: 1.0 From: Stefan Zweig To: pgsql-sql@postgresql.org Subject: strange result for select * from table where id=random()*900 Precedence: fm-user Organization: http://freemail.web.de/ X-Provags-Id: V01U2FsdGVkX1/DKTwN3nOUTe7REnDzceLq7mf7YXvoKk6sVIqs0MZSfFkiS 3MCENl/dA7JIu9wJPY7cQwXV4qQKRBMpn0IxmuHTU2Zk8w3lEBdMJxH5IdjO w== Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.034 tagged_above=0 required=5 tests=AWL=0.033, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200707/164 X-Sequence-Number: 28899 hi list, this is my query: select * from _g2977 where id=floor(random() * (900)); in table _g2977 i have id(s) from 1 up to 900. i just want to select one random dataset by the above query but i does not work. actually i get sometime zero, sometimes one, sometimes two and sometimes even three results back from the above query although i thought it should give only one random dataset from the table. what is wrong? i appreciate any help. thanks in advance, stefan _________________________________________________________________________ In 5 Schritten zur eigenen Homepage. Jetzt Domain sichern und gestalten! Nur 3,99 EUR/Monat! http://www.maildomain.web.de/?mc=021114