On Wed, Jul 02, 2003 at 12:22:08PM -0400, Thomas A. Lowery wrote:
> Not sure if this is a "better" idea or faster, but
> I'd look into using rand() function and limit ... (not tested)
> 
> select X from Y where int(rand()*50000) = 1 limit 1

That will favor rows earlier in the table, but it also has a chance of not
returning a row at all.

Ronald
  • ... Rudy Lippan
    • ... Монашёв Михаил
      • ... Michael A Chase
        • ... Монашёв Михаил
      • ... Thomas A. Lowery
        • ... Монашёв Михаил
        • Ronald J Kimball

Reply via email to