I've created the following function:
CREATE OR REPLACE FUNCTION latest ( lot_id int4,
condition text, OUT perc smallint, OUT entry_date date )
RETURNS SETOF record AS
'
BEGIN
RETURN QUERY SELECT t1.perc, t1.entry_date
FROMt1, t2
WHERE t1.condition_id=t2.id and t1.lo
On 11/07/2010 08:53 AM, Tom Lane wrote:
Andreas Kretschmer writes:
Scott Serr wrote:
Ideas on how to uniquely name the first and second set of "perc,
entry_date"?
You can use alias-names for the 2 queries, like:
test=*# select foobar.a as x, foobar.b as y, bar.* from (select