I am returning results ordered randomly using 'order by random()'. My issue has
to do with page numbers in our web application. When I hit the 2nd page and
retrieve results with an offset, ordering by random() isn't really what I want
since I will often receive results that were on the 1st pag
On 11/29/06, Jeff Herrin <[EMAIL PROTECTED]> wrote:
I am returning results ordered randomly using 'order by random()'. My
issue has to do with page numbers in our web application. When I hit the 2nd
page and retrieve results with an offset, ordering by random() isn't really
what I want since I w
I see that subselects are not directly supported in check clauses,
but one can work around that by writing a stored function which
returns boolean and performs the subselect. Are there any known
gotchas with doing this?
The CREATE TABLE docs regarding CHECK clauses states:
"Currently, CHE
Jeff Herrin <[EMAIL PROTECTED]> schrieb:
> I am returning results ordered randomly using 'order by random()'. My issue
> has
> to do with page numbers in our web application. When I hit the 2nd page and
> retrieve results with an offset, ordering by random() isn't really what I want
> since I wil
I need it a little more random than that. In both these scenarios, the same
items will always follow each other.
Jeff
- Original Message -
Why not create a random seed between 1 and the number of possibilities in your
web application when a user first hits the site, store that in the
I don't think cursors are going to help in this case. The order by random() is
still going to give different result sets on different pages.
Jeff
- Original Message -
From: Andreas Kretschmer <[EMAIL PROTECTED]>
To: pgsql-sql@postgresql.org
Sent: Wednesday, November 29, 2006 12:27:42 PM
On Wed, 29 Nov 2006, James Robinson wrote:
> I see that subselects are not directly supported in check clauses,
> but one can work around that by writing a stored function which
> returns boolean and performs the subselect. Are there any known
> gotchas with doing this?
To completely get the con
Gotcha. This is indeed to ensure a specialized ref integrity bit,
against a column which "ought not ever change". Once some more old
code goes away, then can fully normalize this area, making this check
subselect bit go away, replaced by a regular FK.
Hmm -- probably could even now make it
Hi,
I have three tables t1(a, b, c, d), t2(a, b, c, k), and t3(c, e). I need to
outer join them as shown below, but only have all tuples from t1 as output.
But the following syntax does not allow me to do so.
SELECT t1.*
FROM (t1 outer join t2 on (t1.a=t2.a and t1.b=t2.b)) t outer join t3 on
Would this be more appropriate...?
SELECT t1.*
FROM t1
OUTER JOIN t2 ON (t1.a=t2.a AND t1.b=t2.b)
OUTER JOIN t3 ON (t1.c=t3.c);
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Ehab Galal
Sent: Thursday, 30 November 2006 11:
On Wed, 29 Nov 2006, Ehab Galal wrote:
> I have three tables t1(a, b, c, d), t2(a, b, c, k), and t3(c, e). I need to
> outer join them as shown below, but only have all tuples from t1 as output.
> But the following syntax does not allow me to do so.
>
> SELECT t1.*
> FROM (t1 outer join t2 on (t1.
> SELECT t1.*
> FROM (t1 outer join t2 on (t1.a=t2.a and t1.b=t2.b)) t outer join t3 on
^^
> (t1.c=t3.c);
^^ -- which one t or t1?
> I'm getting the following error message:
> ERROR: invalid reference to FROM-clause entry for table "t1"
"Ehab Galal" <[EMAIL PROTECTED]> writes:
> SELECT t1.*
> FROM (t1 outer join t2 on (t1.a=t2.a and t1.b=t2.b)) t outer join t3 on
> (t1.c=t3.c);
> ERROR: invalid reference to FROM-clause entry for table "t1"
> HINT: There is an entry for table "t1", but it cannot be referenced from
> this part
On Wed, Nov 29, 2006 at 12:32:56PM -0500, Jeff Herrin wrote:
> I don't think cursors are going to help in this case. The order
> by random() is still going to give different result sets on different
> pages.
Have you tried using setseed() to seed the random number generator
to the same value befor
14 matches
Mail list logo