Received: from xyzzy.lan.internal (d226-80-2.home.cgocable.net [24.226.80.2]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAO9mdm21207 for ; Sat, 24 Nov 2001 04:48:39 -0500 (EST) (envelope-from drew@xyzzy.dhs.org) Received: from localhost ([127.0.0.1] helo=there ident=drew) by xyzzy.lan.internal with smtp (Exim 3.32 #1 (Debian)) id 167ZPx-00050l-00; Sat, 24 Nov 2001 04:48:13 -0500 Content-Type: text/plain; charset="iso-8859-1" From: "Andrew G. Hammond" To: =?iso-8859-1?q?Fern=E1ndez=20Mariano?= , Subject: Re: Stored Procedure Date: Sat, 24 Nov 2001 04:48:10 -0500 X-Mailer: KMail [version 1.3.2] References: <006101c17291$6fa84e50$3201010a@mariano> In-Reply-To: <006101c17291$6fa84e50$3201010a@mariano> MIME-Version: 1.0 Message-Id: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by postgresql.org id fAOA2mn21518 X-Archive-Number: 200111/348 X-Sequence-Number: 5730 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2001 November 21 08:35 am, Fernández Mariano wrote: > Hello Pasha > > I'm trying to create a function that return a (select * from table1, > table2..where attrib = $1...) of join. But I can't make this. Like to > Stored Procederue in MS-SQL Server > Can you help me? Looks more like you want a VIEW. For example: CREATE TABLE a (id SERIAL PRIMARY KEY, name TEXT); CREATE TABLE b (id SERIAL PRIMARY KEY, data TEXT, key_a INTEGER REFERENCES a(id)); CREATE VIEW c AS SELECT name, data FROM a, b WHERE a.id = b.key_a; Then simply SELECT from the VIEW. - -- Andrew G. Hammond mailto:drew@xyzzy.dhs.org http://xyzzy.dhs.org/~drew/ 56 2A 54 EF 19 C0 3B 43 72 69 5B E3 69 5B A1 1F 613-389-5481 5CD3 62B0 254B DEB1 86E0 8959 093E F70A B457 84B1 "To blow recursion you must first blow recur" -- me -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjv/bNsACgkQCT73CrRXhLFGkQCfbEwNXXH7/frMpprQtccQ/bEA J5kAnjgH1z/BzRX4WFnS9rFgIRPg2r3H =lrRa -----END PGP SIGNATURE-----