Re: Selecting pairs of numbers

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: John McKown <john(dot)archie(dot)mckown(at)gmail(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Selecting pairs of numbers
Date: 2015-10-05 19:14:10
Message-ID: 5612CC02.2060201@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 05/10/2015 20:03, John McKown wrote:
> When in doubt, cheat! Why not something like:
>
> SELECT x, y FROM organ_pipes WHERE point(x,y) <@
> box(point(?x1,?y1),point(?x2,?y2)) ;
>
> This is definitely a different approach from the others that I've seen.
>
>
> Basically, think of your channel / piston as a point in a Cartesian
> plane. And your boundaries as a box in that graph. So you see if the
> "point" is inside the "box"

Ohhh - that's nice! Reminds of one of my lecturers from college days,
who said there was often a geometrical solution to an algebraic problem.

Thanks!

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2015-10-05 19:33:06 Re: Selecting pairs of numbers
Previous Message Adrian Klaver 2015-10-05 19:08:47 Re: Selecting pairs of numbers