Re: [SQL] strange result for select * from table where id=random()*900

2007-07-27 Thread Tommy Gildseth
() LIMIT 1 -- Tommy Gildseth DBA, Gruppe for databasedrift Universitetet i Oslo, USIT m: +47 45 86 38 50 t: +47 22 85 29 39 ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.post

Re: [SQL] quesion on functions calling from php

2007-04-16 Thread Tommy Gildseth
Karthikeyan Sundaram wrote: Hi, I have written a plpgsql function media_format_func(p_in overlay_format_type) which returns int $sql='select * from media_format_func((200,400,'640*481','jpg')::overlay_format_type)'; $result = $this->objDB->query($sql); print_r($result,1); I should

Re: [SQL] selecting random row values in postgres

2007-02-23 Thread Tommy Gildseth
Sumeet wrote: Thanks Buddy, really appreciate ur help on this problem solved... Is there any way this query can be optimized...i'm running it on a huge table with joins ORDER BY rand() is rather slow on large datasets, since the db has to actually generate a random value for each row in