Re: [SQL] Functions return a select in a table, which data type I

2004-10-29 Thread Markus Bertheau
, 22.10.2004, 15:38, Markus Bertheau : CREATE TYPE foo_type AS (cod_aluno TEXT, nome TEXT, cpf TEXT); CREATE FUNCTION bar(int4) RETURNS SETOF foo_type LANGUAGE 'SQL' That should be LANGUAGE 'plpgsql' AS ' DECLARE var_rec foo_type; BEGIN FOR var_rec IN

Re: [SQL] How do you compare (NULL) and (non-NULL)?

2004-10-29 Thread Wei Weng
Bruno Wolff III wrote: On Tue, Oct 26, 2004 at 16:23:20 -0400, Wei Weng [EMAIL PROTECTED] wrote: In the following query SELECT Parent FROM Channels ORDER BY Parent ASC; If I have a couple of (NULL)s in the field [Parent], they will be listed at the bottom of the query result. Is it because

Re: [SQL] extra info - curious delay on view/where

2004-10-29 Thread Markus Schaber
Hi, Andre, On Thu, 28 Oct 2004 11:53:25 -0300 andre.toscano [EMAIL PROTECTED] wrote: Could an INDEX speed up that SELECT? CREATE VIEW stock_available as SELECT * FROM stock_details WHERE available = true AND visible = true AND location not in (SELECT descr FROM ignored);

Re: [SQL] How do you compare (NULL) and (non-NULL)?

2004-10-29 Thread Bruno Wolff III
On Fri, Oct 29, 2004 at 11:59:15 -0400, Wei Weng [EMAIL PROTECTED] wrote: How do I write that? SELECT Parent FROM Channels ORDER BY Parent IS NULL, Parent ASC; ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster