pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Need a VIEW without SUB-SELECT
2+ messages / 2 participants
[nested] [flat]

* Need a VIEW without SUB-SELECT
@ 2001-10-19 06:01  Bhuvan A <bhuvansql@yahoo.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Bhuvan A @ 2001-10-19 06:01 UTC (permalink / raw)
  To: pgsql-sql


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.




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Need a VIEW without SUB-SELECT
@ 2001-10-19 07:42  Aasmund Midttun Godal <postgresql@envisity.com>
  parent: Bhuvan A <bhuvansql@yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Aasmund Midttun Godal @ 2001-10-19 07:42 UTC (permalink / raw)
  To: pgsql-sql

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 <bhuvansql@yahoo.com> 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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-10-19 07:42 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-10-19 06:01 Need a VIEW without SUB-SELECT Bhuvan A <bhuvansql@yahoo.com>
2001-10-19 07:42 ` Aasmund Midttun Godal <postgresql@envisity.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox