combining a single field in two tables into one column.

From: JT Kirkpatrick <jt-kirkpatrick(at)mpsllc(dot)com>
To: "'pgsql-sql(at)hub(dot)org'" <pgsql-sql(at)hub(dot)org>
Subject: combining a single field in two tables into one column.
Date: 1999-04-30 15:59:05
Message-ID: 01BE9300.DA3BFC80.jt-kirkpatrick@mpsllc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

i come seeking wisdom. . .

i have two tables, one for subcontractors and another for vendors. subs
have a primary key of subnum int4, vendors a primary key of vnum int4. i
need to create a query that allows me to see a complete list of these
numbers in a single column. for instance, subnum (all begin with 9) has
values 90001, 90002, 90003 (only three records for the example), and vnum
(all begin with 2) has values 20001, 20002. i'd like my query result to
show:

90001
90002
90003
20001
20002

this does NOT work: select a.subnum as z, b.vnum as z from subs a, vend b;
NOR does: select a.subnum, b.vnum from subs a, vend b;

by the way, the two tables DO NOT relate to each other (i.e., 90001 does
not have anything to do with 20001). . .

TIA, jt

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jackson, DeJuan 1999-04-30 16:02:47 RE: [SQL] combining a single field in two tables into one column.
Previous Message Jackson, DeJuan 1999-04-30 15:39:27 RE: [SQL] Limit Questions 2