From: | "Bradley J(dot) Bartram" <bbartram(at)dyrectmedia(dot)com> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Stored Procedure Assistance |
Date: | 2003-07-08 16:55:00 |
Message-ID: | 200307081255.00649.bbartram@dyrectmedia.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I'm relatively new to stored procedures and I've run into a situation that is
above my current level of ability and I can't seem to find any examples of
how to go about it.
Here is the run down of what I need to do, if someone could either give me an
exmaple or even a nice repository of information on how to do this, I would
be quite grateful.
I'm looking at a series of queries, all simple selects, that are run to
produce a final result set. Right now they are coded in php and there are
some techniques used to construct the queries that I'm trying to duplicate on
the backend.
The first query is simple:
SELECT a FROM table_a WHERE column_a = b
This will return a single row. The next query takes that derived value and
does a simliar select that returns multiple rows.
SELECT c FROM table_b WHERE column_b = a
The next query has some logic in php that constructs it. Basically if c > 0
than the results of query 2 are setup as ORs in the WHERE clause.
SELECT d FROM table_c WHERE column_c = c1 OR column_c = c2, etc.
The first two queries are not a problem, but how can I take the array of
results from query 2 and put them into query 3?
Thanks in advance.
brad
--
Bradley J. Bartram
From | Date | Subject | |
---|---|---|---|
Next Message | Maksim Likharev | 2003-07-08 17:14:55 | Re: PG crash on simple query, story continues |
Previous Message | Maksim Likharev | 2003-07-08 16:34:33 | Re: PG crash on simple query, story continues |