Received: from shell.mpsi.net (alewis@shell.mpsi.net [207.252.220.24]) by hub.org (8.9.2/8.9.1) with ESMTP id NAA57356 for ; Wed, 3 Feb 1999 13:16:04 -0500 (EST) (envelope-from alewis@mpsi.net) Received: from localhost (alewis@localhost) by shell.mpsi.net (8.8.8/8.8.6.Beta3) with ESMTP id MAA10437 for ; Wed, 3 Feb 1999 12:16:04 -0600 Date: Wed, 3 Feb 1999 12:16:03 -0600 (CST) From: Andy To: pgsql-sql@postgresql.org Subject: Two table select Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I have two queries that I'd like to make as one. Here are the queries: select * from referral where oid = $some_oid select bldgname from apts where bldgnum = 'rbldg1' I am trying to get the bldgname from the apts table and want to get all of the bldgname's including rbldg2, rbldg3, rbldg4. Trying to do it in one select statment, is this possible? table = referral +----------------------------------+----------------------------------+-------+ | rstate | varchar() | 2 | | rrif | varchar() | 10 | | rphone | varchar() | 20 | | rfirstname | varchar() | 20 | | rlastname | varchar() | 25 | | rbldg1 | varchar() | 10 | | rbldgcomment1 | text | var | | rbldg2 | varchar() | 10 | | rbldgcomment2 | text | var | | rbldg3 | varchar() | 10 | | rbldgcomment3 | text | var | | rbldg4 | varchar() | 10 | .... +----------------------------------+----------------------------------+-------+ Thanks in advance Andy