pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: ryanne cruz <ryanne.cruz@up.edu.ph>
To: \\\"pgsql-php@postgresql.org\\\" <pgsql-php@postgresql.org>
Subject: Re: querying from 3 tables
Date: Fri,  7 Mar 2003 13:11:04 +0800
Message-ID: <1047013864.3e6829e837bdb@mail.up.edu.ph> (raw)

 
hi list. 
 
i have 3 tables with the following columns: 
 
table1: esourceid (primary key), brgyid, households 
table2: brgyid (primary key), munprovid 
table3: munprovid (primary key), geom 
 
i am given the esourceid and i need to query the brgyid and the households of 
a particular esourceid: query1="select brgyid, households from table1 where 
esourceid=$esourceid;" 
 
the resulting brgyid will then be used to query for the munprovid in table2: 
query2="select munprovid from table2 where brgyid=(query1);" 
 
the resulting munprovid will then be used to query for  the geom column: 
"select geom from table3 where munprovid=(query2);" 
 
my question is, how do i do this? any ideas?  



view thread (5+ messages)  latest in thread

Message-ID: <1047013864.3e6829e837bdb@mail.up.edu.ph>
Permalink:  ../1047013864.3e6829e837bdb@mail.up.edu.ph/
Also on:    postgresql.org/message-id/1047013864.3e6829e837bdb@mail.up.edu.ph

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: ryanne.cruz@up.edu.ph
  Subject: Re: querying from 3 tables
  In-Reply-To: <1047013864.3e6829e837bdb@mail.up.edu.ph>
  References: <1047013864.3e6829e837bdb@mail.up.edu.ph>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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