pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Two table select
3+ messages / 3 participants
[nested] [flat]

* Two table select
@ 1999-02-03 18:16 Andy <alewis@mpsi.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Andy @ 1999-02-03 18:16 UTC (permalink / raw)
  To: pgsql-sql

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




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

* RE: [SQL] Two table select
@ 1999-02-03 18:53 Jackson, DeJuan <djackson@cpsgroup.com>
  1999-02-03 19:50 ` Re: [SQL] Two table select Jan Wieck <jwieck@debis.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Jackson, DeJuan @ 1999-02-03 18:53 UTC (permalink / raw)
  To: Andy <alewis@mpsi.net>; pgsql-sql

huh?!.
Need more (comprehensible) information...
Maybe it's just me,
	-DEJ

> -----Original Message-----
> From: Andy [mailto:alewis@mpsi.net]
> Sent: Wednesday, February 03, 1999 12:16 PM
> To: pgsql-sql@postgreSQL.org
> Subject: [SQL] Two table select
> 
> 
> 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
> 
> 



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

* Re: [SQL] Two table select
  1999-02-03 18:53 RE: [SQL] Two table select Jackson, DeJuan <djackson@cpsgroup.com>
@ 1999-02-03 19:50 ` Jan Wieck <jwieck@debis.com>
  0 siblings, 0 replies; 3+ messages in thread

From: jwieck@debis.com @ 1999-02-03 19:50 UTC (permalink / raw)
  To: djackson@cpsgroup.com; +Cc: alewis@mpsi.net; pgsql-sql

>
> huh?!.
> Need more (comprehensible) information...
> Maybe it's just me,
>    -DEJ
>

    Not  only  you. I wasn't able to puzzle out what's the wanted
    result too.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #





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


end of thread, other threads:[~1999-02-03 19:50 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-02-03 18:16 Two table select Andy <alewis@mpsi.net>
1999-02-03 18:53 RE: [SQL] Two table select Jackson, DeJuan <djackson@cpsgroup.com>
1999-02-03 19:50 ` Jan Wieck <jwieck@debis.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