Received: from ns.krot.org (ns.krot.org [193.212.103.165]) by postgresql.org (8.11.3/8.11.4) with SMTP id f9J7jfP15265 for ; Fri, 19 Oct 2001 03:45:44 -0400 (EDT) (envelope-from postgresql@envisity.com) Received: (qmail 90 invoked by uid 67); 19 Oct 2001 07:42:04 -0000 Message-ID: <20011019074204.18032.qmail@ns.krot.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline MIME-Version: 1.0 From: "Aasmund Midttun Godal" To: pgsql-sql@postgresql.org Subject: Re: Need a VIEW without SUB-SELECT Date: Fri, 19 Oct 2001 07:42:04 GMT X-Mailer: Googley-Moogley In-Reply-To: from Bhuvan A on Fri, 19 Oct 2001 11:31:45 +0530 (IST) References: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by postgresql.org id f9J8ATM44762 X-Archive-Number: 200110/275 X-Sequence-Number: 5228 CREATE VIEW status_schmetus AS SELECT approval.status_name AS aproval_status_name, acknowledgement.status_name AS acknowledgement_status_name FROM po_status JOIN status AS approval ON(po_status.approval_status_id = status.status_id) JOIN status AS acknowledgement ON(po_status.acknowledgement_status_id = status.status_id); Should do it i think, but I did not test it. Regards, Aasmund. On Fri, 19 Oct 2001 11:31:45 +0530 (IST), Bhuvan A wrote: > > Hi all, > > Kindly apologize any inconvenience! > > I have 2 tables status and po_status like.. > > CREATE TABLE status ( > status_id int primary key, > status_name varchar(15) > ); > > CREATE TABLE po_status ( > po_no varchar(15), > approval_status_id int references status(status_id), > acknowledgement_status_id int references status(status_id) > ); > > > Right.. > > Now, how can i have a VIEW on po_status table to get > 'approval_status_name' and 'acknowledgement_status_name' instead of > approval_status_id and acknowledgement_status_id? > > I am sure that a VIEW with SUB-SELECT will solve everything. But my QB > won't support SUB-SELECT and i wasn't ready to redesign my QB, which > is a time consuming process. > > How can i accompolish this ???? > > Thankx in advance. > > ====================================================================== > Kime's Law for the Reward of Meekness: > Turning the other cheek merely ensures two bruised cheeks > ====================================================================== > > Regards, > Bhuvaneswar. > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) Aasmund Midttun Godal aasmund@godal.com - http://www.godal.com/ +47 40 45 20 46