On Tue, Jun 19, 2007 at 02:02:46PM -0400, John Gunther wrote:
> Well, Andrew, you're certainly right but I made an exception because of
> the data needs.
Ah, well, in that case, you'll need something other than SQL for
sure. A function as suggested is probably your friend.
A
--
Andrew Sullivan
Andreas Kretschmer wrote:
create or replace function zip_foo(OUT out_id int, OUT out_name text, OUT
out_name2 text) returns setof record as $$
declare
my_rec RECORD;
my_name TEXT;
begin
for my_rec in select id, name, parent_tbl, parent_id from zip LOOP
e
Andrew Sullivan wrote:
On Sun, Jun 17, 2007 at 04:39:51AM -0400, John Gunther wrote:
functions and using subqueries without success. I think I need someone
to point me in the right conceptual direction.
Well, the right SQL-esque conceptual direction is not to have
diffe
On Sun, Jun 17, 2007 at 04:39:51AM -0400, John Gunther wrote:
> functions and using subqueries without success. I think I need someone
> to point me in the right conceptual direction.
Well, the right SQL-esque conceptual direction is not to have
different tables at all. That's not a very normal-
John Gunther <[EMAIL PROTECTED]> schrieb:
> I've tried everything I can think of here to join records when the join
> table varies and is named in the primary record, but to no avail. Here's an
> example with all non-essentials stripped out.
>
> I have 3 tables:
>
> create table zip (
> id se
I've tried everything I can think of here to join records when the join
table varies and is named in the primary record, but to no avail. Here's
an example with all non-essentials stripped out.
I have 3 tables:
create table zip (
id serial primary key,
name text,
parent_tbl text,
parent_id in