Re: sql select challenge - Mailing list pgsql-general

From
Subject Re: sql select challenge
Date
Msg-id 002601bfd483$56a436b0$0602010a@bullwinkle.vectormath
Whole thread Raw
In response to sql select challenge  (Travis Bauer <trbauer@indiana.edu>)
List pgsql-general
Hi Travis,

I know this is not what you're asking for, and I
imagine you have already thought of this, but just
in case . . .

You could add an extra column to each of your
tables.  These columns would be populated by a
procedure that runs through the existing recordset
and assigns sequential numbers to them.  You would
flush these columns and repopulate them each time
you run your query.  Your query would have an
outer join on these two columns.  (by the way, I
think that you will not be able to get away from
using programming to solve your problem)

David Boerwinkle
-----Original Message-----
From: Travis Bauer <trbauer@indiana.edu>
To: pgsql-general@postgresql.org
<pgsql-general@postgresql.org>
Date: Monday, June 12, 2000 8:20 AM
Subject: [GENERAL] sql select challenge


>Let's say I have two tables with the follwing
data:
>
>Table_X
>
>A  |  B
>---------
>1  |  Cat
>2  |  Dog
>3  |  Mouse
>4  |  Hat
>
>Table_Y
>
>C  |  D
>---------
>2  | Eat
>4  | Book
>
>
>I would like a select statement that joins these
two tables to produce the
>following.  It lines up the rows one by one
against one another simply by
>the order they appear in the table, but not by
any other criteria:
>
>View_XY
>
>A  | B      |   C   |  D
>----------------------------
>1  | Cat    |  2    |  Eat
>2  | Dog    |  4    |  Book
>3  | Mouse  |       |
>4  | Hat    |       |
>
>Any ideas?
>
>Thank you,
>
>
>-------------------------------------------------
---------------
>Travis Bauer | CS Grad Student | IU
|www.cs.indiana.edu/~trbauer
>-------------------------------------------------
---------------
>


pgsql-general by date:

Previous
From: Travis Bauer
Date:
Subject: sql select challenge
Next
From: Tom Lane
Date:
Subject: Re: Problem with upper() in select statement