Skip site navigation (1) Skip section navigation (2)

Re: Question

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Chris Travers <chris(at)travelamericas(dot)com>
Cc: David Costa <geeks(at)dotgeek(dot)org>, pgsql-advocacy(at)postgresql(dot)org
Subject: Re: Question
Date: 2004-02-28 22:49:23
Message-ID: 200402282249.i1SMnNa21189@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-advocacy
Chris Travers wrote:
> On Sat, 2004-02-21 at 09:13, David Costa wrote:
> 
> > dead elephant  ;) what about a cool one line postgresql query in lieu 
> > of him ? could demonstrate the logic power of postgresql vs mysql and 
> > others
> > anyone willing to share a nice one ?
> 
> Hmmm....  Thinking of PostgreSQL vs MySQL vs. Firebird.....
> 
> Unfortunately most of my complex queries are 8-10 lines long and use
> features such as subselects and UNION statements.  Those will show the
> difference between MySQL and PostgreSQL, but should work in
> Interbase/Firebird.
> 
> I am afraid the request to demonstrate the logic power of PostgreSQL in
> one line is sort of like asking for a proof to Fermat's Theorem in one
> double-spaced page and normal font size.  If someone can do this, I will
> be quite impressed :-P

How about:

	SELECT * FROM tab ORDER BY random() LIMIT 5

to pull 5 random rows from a table.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

pgsql-advocacy by date

Next:From: Kaare RasmussenDate: 2004-02-29 01:35:59
Subject: Re: Collaboration Tool Proposal
Previous:From: Greg Sabino MullaneDate: 2004-02-28 17:05:16
Subject: Re: [HACKERS] Collaboration Tool Proposal

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group